Skip to content

Commit

Permalink
chore(ci): fix release sha for backport
Browse files Browse the repository at this point in the history
  • Loading branch information
everpcpc committed Jan 10, 2025
1 parent 12a5c8d commit 11b144b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/scripts/bump_version.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,27 @@ module.exports = async ({ github, context, core }) => {
}

case "patch": {
core.setOutput("sha", context.sha);
if (!TAG) {
core.setFailed("Patch release must be triggered with a stable tag");
return;
}
core.info(`Patch release triggered by ${TAG} (${context.sha})`);
core.info(`Patch release triggered by ${TAG}`);
const result = RE_TAG_STABLE.exec(TAG);
if (!result) {
core.setFailed(`The tag ${TAG} is invalid, ignoring`);
return;
}

const branch = await github.rest.repos.getBranch({
owner: context.repo.owner,
repo: context.repo.repo,
branch: `backport/${TAG}`,
});
core.setOutput("sha", branch.data.commit.sha);
core.info(
`Patch release triggered by ${TAG} (${branch.data.commit.sha})`
);

let pv = 1;
let previous = null;
let page = 1;
Expand Down

0 comments on commit 11b144b

Please sign in to comment.