Skip to content

Commit fc517df

Browse files
authored
chore: prefix Node staging PR titles (#10033)
Staging Node.js PRs now use the title format `[vN.x] <commit title>`. The workflow also updates existing PR titles when rerun, while titles targeting `main` remain unchanged. Copilot-Session: 06837b36-bfb9-4c5b-a0cf-e18e06957b37
1 parent 7c78fe0 commit fc517df

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎scripts/create-node-pr.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ const main = async (spec, branch = 'main', opts) => withTempDir(CWD, async (tmpD
172172

173173
const nodeRemote = 'origin'
174174
const nodeBranch = /^\d+$/.test(branch) ? `v${branch}.x-staging` : branch
175+
const stagingVersion = nodeBranch.match(/^(v\d+\.x)-staging$/)?.[1]
176+
const nodePrTitle = `${stagingVersion ? `[${stagingVersion}] ` : ''}${npmMessage()}`
175177
const nodeHost = hgi.fromUrl(await gitNode('remote', 'get-url', nodeRemote, { out: true }))
176178
const nodePrArgs = ['pr', '-R', nodeHost.path()]
177179

@@ -263,7 +265,7 @@ const main = async (spec, branch = 'main', opts) => withTempDir(CWD, async (tmpD
263265
nodePrArgs,
264266
(existingPr ? ['edit', existingPr.number] : ['create', '-H', `${npmHost.user}:${npmBranch}`]),
265267
'-B', nodeBranch,
266-
(existingPr ? [] : ['-t', npmMessage()]),
268+
'-t', nodePrTitle,
267269
].flat()
268270

269271
if (dryRun) {

0 commit comments

Comments
 (0)