diff --git a/packages/core/src/auto.ts b/packages/core/src/auto.ts index 758a26246..54613d133 100644 --- a/packages/core/src/auto.ts +++ b/packages/core/src/auto.ts @@ -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,