Skip to content

fix(git-node): allow security release promotion #900

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
8 changes: 6 additions & 2 deletions 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 @@ -391,7 +395,7 @@ export default class ReleasePromotion extends Session {
// Set up the branch so that nightly builds are produced with the next
// version number and a pre-release tag.
async setupForNextRelease() {
const { versionComponents, prid } = this;
const { versionComponents, prid, owner, repo } = this;

// Update node_version.h for next patch release.
const filePath = path.resolve('src', 'node_version.h');
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/${owner}/${repo}/pull/${prid}`
], { ignoreFailure: false });
const workingOnNewReleaseCommit = await forceRunAsync('git', ['rev-parse', 'HEAD'],
{ ignoreFailure: false, captureStdout: true });
Expand Down
Loading