Skip to content

Commit

Permalink
Merge pull request #2252 from laughedelic/patch-1
Browse files Browse the repository at this point in the history
version: take into account current PR labels
  • Loading branch information
hipstersmoothie committed Sep 13, 2022
2 parents 2a5d773 + f1880a7 commit a0137eb
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions packages/core/src/auto.ts
Expand Up @@ -1829,23 +1829,20 @@ export default class Auto {

let calculatedBump = await this.release.getSemverBump(lastRelease);

// For next releases we also want to take into account any labels on
// the PR of next into main
if (isPrerelease) {
const pr = getPrNumberFromEnv();

if (pr && this.semVerLabels) {
const prLabels = await this.git.getLabels(pr);
this.logger.verbose.info(
`Found labels on prerelease branch PR`,
prLabels
);
calculatedBump = calculateSemVerBump(
[prLabels, [calculatedBump]],
this.semVerLabels,
this.config
);
}
// Take into account any labels on the PR
const pr = getPrNumberFromEnv();

if (pr && this.semVerLabels) {
const prLabels = await this.git.getLabels(pr);
this.logger.verbose.info(
`Found labels on prerelease branch PR`,
prLabels
);
calculatedBump = calculateSemVerBump(
[prLabels, [calculatedBump]],
this.semVerLabels,
this.config
);
}

const bump =
Expand Down

0 comments on commit a0137eb

Please sign in to comment.