Skip to content

Commit

Permalink
fix(git-node): allow security release promotion
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Jan 21, 2025
1 parent cce9b81 commit 444d0f9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions components/git/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,10 @@ function release(state, argv) {
}

async function main(state, argv, cli, dir) {
const prID = /^(?:https:\/\/github\.com\/nodejs\/node\/pull\/)?(\d+)$/.exec(argv.prid);
const prID = /^(?:https:\/\/github\.com\/nodejs(-private)?\/node\1\/pull\/)?(\d+)$/.exec(argv.prid);
if (prID) {
argv.prid = Number(prID[1]);
if (prID[1]) argv.security = true;
argv.prid = Number(prID[2]);
}
if (state === PREPARE) {
const release = new ReleasePreparation(argv, cli, dir);
Expand Down
6 changes: 5 additions & 1 deletion lib/promote_release.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ export default class ReleasePromotion extends Session {
constructor(argv, req, cli, dir) {
super(cli, dir, argv.prid);
this.req = req;
if (argv.security) {
this.config.owner = 'nodejs-private';
this.config.repo = 'node-private';
}
this.dryRun = !argv.run;
this.isLTS = false;
this.ltsCodename = '';
Expand Down Expand Up @@ -422,7 +426,7 @@ export default class ReleasePromotion extends Session {
'-m',
`Working on ${workingOnVersion}`,
'-m',
`PR-URL: https://github.com/nodejs/node/pull/${prid}`
`PR-URL: https://github.com/${this.config.owner}/${this.config.owner}/pull/${prid}`
], { ignoreFailure: false });
const workingOnNewReleaseCommit = await forceRunAsync('git', ['rev-parse', 'HEAD'],
{ ignoreFailure: false, captureStdout: true });
Expand Down

0 comments on commit 444d0f9

Please sign in to comment.