Skip to content

Commit 4a03216

Browse files
authored
fix(git-node): allow security release promotion (#900)
1 parent c408dd9 commit 4a03216

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

components/git/release.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,10 @@ function release(state, argv) {
112112
}
113113

114114
async function main(state, argv, cli, dir) {
115-
const prID = /^(?:https:\/\/github\.com\/nodejs\/node\/pull\/)?(\d+)$/.exec(argv.prid);
115+
const prID = /^(?:https:\/\/github\.com\/nodejs(-private)?\/node\1\/pull\/)?(\d+)$/.exec(argv.prid);
116116
if (prID) {
117-
argv.prid = Number(prID[1]);
117+
if (prID[1]) argv.security = true;
118+
argv.prid = Number(prID[2]);
118119
}
119120
if (state === PREPARE) {
120121
const release = new ReleasePreparation(argv, cli, dir);

lib/promote_release.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ export default class ReleasePromotion extends Session {
1919
constructor(argv, req, cli, dir) {
2020
super(cli, dir, argv.prid);
2121
this.req = req;
22+
if (argv.security) {
23+
this.config.owner = 'nodejs-private';
24+
this.config.repo = 'node-private';
25+
}
2226
this.dryRun = !argv.run;
2327
this.isLTS = false;
2428
this.ltsCodename = '';
@@ -398,7 +402,7 @@ export default class ReleasePromotion extends Session {
398402
// Set up the branch so that nightly builds are produced with the next
399403
// version number and a pre-release tag.
400404
async setupForNextRelease() {
401-
const { versionComponents, prid } = this;
405+
const { versionComponents, prid, owner, repo } = this;
402406

403407
// Update node_version.h for next patch release.
404408
const filePath = path.resolve('src', 'node_version.h');
@@ -429,7 +433,7 @@ export default class ReleasePromotion extends Session {
429433
'-m',
430434
`Working on ${workingOnVersion}`,
431435
'-m',
432-
`PR-URL: https://github.com/nodejs/node/pull/${prid}`
436+
`PR-URL: https://github.com/${owner}/${repo}/pull/${prid}`
433437
], { ignoreFailure: false });
434438
const workingOnNewReleaseCommit = await forceRunAsync('git', ['rev-parse', 'HEAD'],
435439
{ ignoreFailure: false, captureStdout: true });

0 commit comments

Comments
 (0)