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

version: take into account current PR labels #2252

Merged
merged 1 commit into from Sep 13, 2022
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
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