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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rearrange to allow dryrun to leverage prefixed tag #1976

Merged
merged 2 commits into from May 8, 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
20 changes: 10 additions & 10 deletions plugins/git-tag/src/index.ts
Expand Up @@ -44,23 +44,23 @@ export default class GitTagPlugin implements IPlugin {
const lastTag = await getTag();
const newTag = inc(lastTag, bump as ReleaseType);

if (dryRun && newTag) {
if (quiet) {
console.log(newTag);
} else {
auto.logger.log.info(`Would have published: ${newTag}`);
}

return;
}

if (!newTag) {
auto.logger.log.info("No release found, doing nothing");
return;
}

const prefixedTag = auto.prefixRelease(newTag);

if (dryRun) {
if (quiet) {
console.log(prefixedTag);
} else {
auto.logger.log.info(`Would have published: ${prefixedTag}`);
}

return;
}

auto.logger.log.info(`Tagging new tag: ${lastTag} => ${prefixedTag}`);
await execPromise("git", [
"tag",
Expand Down