Skip to content

Commit

Permalink
Merge pull request #1791 from intuit/base-tag-next
Browse files Browse the repository at this point in the history
When calculating "next" lastTag, fallback to latest tag in baseBranch before first commit
  • Loading branch information
hipstersmoothie committed Feb 11, 2021
2 parents 5828f13 + 41ec65e commit 19a8555
Showing 1 changed file with 6 additions and 1 deletion.
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

0 comments on commit 19a8555

Please sign in to comment.