Skip to content

Commit

Permalink
Merge pull request #1133 from intuit/pr-check-next
Browse files Browse the repository at this point in the history
pr-check: succeed on pre-release branch PRs
  • Loading branch information
hipstersmoothie authored Apr 7, 2020
2 parents 3e7eecc + 47ebe2e commit f74b890
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions packages/core/src/auto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -858,29 +858,35 @@ export default class Auto {
!skipReleaseLabels.includes(l) &&
l !== "release"
);

if (semverTag === undefined && !skipReleaseTag) {
const branch = getCurrentBranch();

if (branch && this.config?.prereleaseBranches.includes(branch)) {
msg = {
description: "PR will graduate prerelease once merged",
state: "success",
};
} else if (semverTag === undefined && !skipReleaseTag) {
throw new Error("No semver label!");
}
} else {
this.logger.log.success(
`PR is using label: ${semverTag || skipReleaseTag}`
);

this.logger.log.success(
`PR is using label: ${semverTag || skipReleaseTag}`
);
let description;

let description;
if (skipReleaseTag) {
description = "PR will not create a release";
} else if (releaseTag) {
description = `PR will create release once merged - ${semverTag}`;
} else {
description = `CI - ${semverTag}`;
}

if (skipReleaseTag) {
description = "PR will not create a release";
} else if (releaseTag) {
description = `PR will create release once merged - ${semverTag}`;
} else {
description = `CI - ${semverTag}`;
msg = {
description,
state: "success",
};
}

msg = {
description,
state: "success",
};
} catch (error) {
msg = {
description: error.message,
Expand Down

0 comments on commit f74b890

Please sign in to comment.