Skip to content

Commit

Permalink
Allow new release create-rc based off stable branch (#5209)
Browse files Browse the repository at this point in the history
  • Loading branch information
wemeetagain authored Feb 27, 2023
1 parent 6429685 commit d5c08e3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions scripts/release/create_rc.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,16 @@ if (!semver.gt(versionMMP, currentVersion)) {
const currentBranch = getCurrentBranch();
if (semver.patch(versionMMP) === 0) {
// New version release candidate
// This script must be run from unstable branch
if (currentBranch !== UNSTABLE_BRANCH) {
// This script must be run from unstable or stable branch
if (currentBranch === STABLE_BRANCH) {
console.warn(`Warning: Creating a new release from branch ${STABLE_BRANCH}. In most cases, a new release should be based off branch ${UNSTABLE_BRANCH} and only hotfixes should be based off branch ${STABLE_BRANCH}`);
assertCommitExistsInBranch(commit, STABLE_BRANCH);
} else if (currentBranch === UNSTABLE_BRANCH) {
assertCommitExistsInBranch(commit, UNSTABLE_BRANCH);
} else {
throw Error(`Must be run in branch '${UNSTABLE_BRANCH}' but is in '${currentBranch}'`);
}

assertCommitExistsInBranch(commit, UNSTABLE_BRANCH);
} else {
// Hot-fix release candidate
// This script must be run from unstable branch
Expand Down

0 comments on commit d5c08e3

Please sign in to comment.