Skip to content

Commit

Permalink
Update publish workflow to auto merge changes from default branch to …
Browse files Browse the repository at this point in the history
…release branch
  • Loading branch information
mayank1513 committed Dec 19, 2024
1 parent 98248ab commit bdd88e4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions scripts/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,17 @@ const [newMajor, newMinor] = VERSION.split(".");
const [oldMajor, oldMinor] = LATEST_VERSION.split(".");

const isPatch = newMajor === oldMajor && newMinor === oldMinor;
const releaseBranch = `release-${newMajor}.${newMinor}`;
const DEFAULT_BRANCH = process.env.DEFAULT_BRANCH;

if (!isPatch) {
if (isPatch) {
// update release branch
execSync(
`git checkout ${releaseBranch} && git merge ${DEFAULT_BRANCH} && git push origin ${releaseBranch}`,
);
} else {
require("./update-security-md")(`${newMajor}.${newMinor}`, `${oldMajor}.${oldMinor}`);
/** Create new release branch for every Major or Minor release */
const releaseBranch = `release-${newMajor}.${newMinor}`;
execSync(`git checkout -b ${releaseBranch} && git push origin ${releaseBranch}`);
}

Expand Down

0 comments on commit bdd88e4

Please sign in to comment.