Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

canary shouldn't make changes on dry run #1969

Merged
merged 1 commit into from Apr 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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