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

When calculating "next" lastTag, fallback to latest tag in baseBranch before first commit #1791

Merged
merged 1 commit into from Feb 11, 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
7 changes: 6 additions & 1 deletion packages/core/src/auto.ts
Expand Up @@ -1384,9 +1384,14 @@ export default class Auto {
const [, latestTagInBranch] = await on(
this.git.getLatestTagInBranch(currentBranch)
);
const [, tagsInBaseBranch] = await on(
this.git.getTags(`origin/${this.baseBranch}`)
);
const [latestTagInBaseBranch] = (tagsInBaseBranch || []).reverse();
const lastTag =
lastTagNotInBaseBranch ||
latestTagInBranch ||
latestTagInBaseBranch ||
(await this.git.getFirstCommit());

const fullReleaseNotes = await this.release.generateReleaseNotes(
Expand All @@ -1400,7 +1405,7 @@ export default class Auto {
if (bump === SEMVER.noVersion) {
if (options.force) {
bump = SEMVER.patch;
} else {;
} else {
this.logger.log.info("No version published.");
return;
}
Expand Down