Skip to content

Commit

Permalink
Merge pull request #1969 from laughedelic/fix/canary-dry-run
Browse files Browse the repository at this point in the history
  • Loading branch information
hipstersmoothie committed Apr 28, 2021
2 parents 66f7cbd + e562e2c commit 6fad656
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/core/src/auto.ts
Expand Up @@ -1245,7 +1245,7 @@ export default class Auto {
bump = SEMVER.patch;
} else {
this.logger.log.info(
"Skipping canary release due to PR being specifying no release. Use `auto canary --force` to override this setting"
"Skipping canary release due to PR specifying no release. Use `auto canary --force` to override this setting"
);
return;
}
Expand Down Expand Up @@ -1297,7 +1297,7 @@ export default class Auto {
: `<code>${newVersion}</code>`
);

if (options.message !== "false" && pr) {
if (!options.dryRun && options.message !== "false" && pr) {
const prNumber = Number(pr);
const message =
typeof result === "string"
Expand Down Expand Up @@ -1333,15 +1333,18 @@ export default class Auto {
}
}

const verb = options.dryRun ? "Would have published" : "Published"
this.logger.log.success(
`Published canary version${newVersion ? `: ${newVersion}` : ""}`
`${verb} canary version${newVersion ? `: ${newVersion}` : ""}`
);

if (args.quiet) {
console.log(newVersion);
}

await gitReset();
if (!options.dryRun) {
await gitReset();
}

return { newVersion, commitsInRelease, context: "canary" };
}
Expand Down

0 comments on commit 6fad656

Please sign in to comment.