mirror of
https://github.com/changesets/action
synced 2026-10-26 16:39:56 +08:00
Improve log messages (#730)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@changesets/action": patch
|
||||
---
|
||||
|
||||
Improve log messages
|
||||
+2
-2
@@ -195,7 +195,7 @@ export class GitHub {
|
||||
if (authorIdentity.exitCode === 0 && committerIdentity.exitCode === 0) {
|
||||
return;
|
||||
}
|
||||
core.info("Setting Git user to github-actions[bot]");
|
||||
core.info("Setting git user to github-actions[bot]");
|
||||
await exec("git", ["config", "user.name", `"github-actions[bot]"`], {
|
||||
cwd: this.cwd,
|
||||
});
|
||||
@@ -222,7 +222,7 @@ export class GitHub {
|
||||
})
|
||||
.catch((err) => {
|
||||
// Assuming tag was manually pushed in custom publish script
|
||||
core.warning(`Failed to create tag ${tag}: ${err.message}`);
|
||||
core.warning(`Failed to create git tag "${tag}": ${err.message}`);
|
||||
});
|
||||
}
|
||||
await exec("git", ["push", "origin", tag], {
|
||||
|
||||
+3
-4
@@ -68,7 +68,7 @@ async function main() {
|
||||
switch (true) {
|
||||
case !hasChangesets && !hasPublishScript:
|
||||
core.info(
|
||||
"No changesets present or were removed by merging release PR. Not publishing because no publish script found.",
|
||||
"No changesets present or were removed by merging version PR. Not publishing because publish-script is not set.",
|
||||
);
|
||||
return;
|
||||
case !hasChangesets && hasPublishScript: {
|
||||
@@ -104,7 +104,7 @@ async function main() {
|
||||
}
|
||||
|
||||
if (result.exitCode !== 0) {
|
||||
core.error(
|
||||
throw new Error(
|
||||
`Publish command exited with code ${result.exitCode}${
|
||||
result.published
|
||||
? `, but some packages were published: ${result.publishedPackages
|
||||
@@ -113,12 +113,11 @@ async function main() {
|
||||
: ""
|
||||
}`,
|
||||
);
|
||||
process.exit(result.exitCode);
|
||||
}
|
||||
return;
|
||||
}
|
||||
case hasChangesets && !hasNonEmptyChangesets:
|
||||
core.info("All changesets are empty; not creating PR");
|
||||
core.info("All changesets are empty. Not creating PR");
|
||||
return;
|
||||
case hasChangesets: {
|
||||
const { pullRequestNumber } = await runVersion({
|
||||
|
||||
+3
-3
@@ -401,7 +401,7 @@ export async function runVersion({
|
||||
head: `${context.repo.owner}:${versionBranch}`,
|
||||
base: branch,
|
||||
});
|
||||
core.info(
|
||||
core.debug(
|
||||
`Existing pull requests: ${JSON.stringify(
|
||||
existingPullRequests.data,
|
||||
null,
|
||||
@@ -427,7 +427,7 @@ export async function runVersion({
|
||||
});
|
||||
|
||||
if (existingPullRequests.data.length === 0) {
|
||||
core.info("creating pull request");
|
||||
core.info("Creating pull request");
|
||||
const { data: newPullRequest } = await octokit.rest.pulls.create({
|
||||
base: branch,
|
||||
head: versionBranch,
|
||||
@@ -443,7 +443,7 @@ export async function runVersion({
|
||||
} else {
|
||||
const [pullRequest] = existingPullRequests.data;
|
||||
|
||||
core.info(`updating found pull request #${pullRequest.number}`);
|
||||
core.info(`Updating found pull request #${pullRequest.number}`);
|
||||
const convertPullRequestToDraftMutation =
|
||||
prDraft === "always"
|
||||
? `
|
||||
|
||||
Reference in New Issue
Block a user