Skip to content

Commit f020fba

Browse files
chore: recognize prefixed Node.js PR titles (#9925)
Backport of #9915 to `release/v11`. Co-authored-by: Tea Reggi <[email protected]> Copilot-Session: 14a9626a-4d0e-4be3-b06c-b6676ecb3895
1 parent b872816 commit f020fba

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎scripts/create-node-pr.js‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,13 @@ const main = async (spec, branch = 'main', opts) => withTempDir(CWD, async (tmpD
238238

239239
let existingPr = null
240240
const closePrs = []
241+
const npmMessagePrefix = npmMessage('')
241242

242243
for (const pr of npmPrs) {
243-
const prVersion = pr.title.replace(npmMessage(''), '').trim()
244+
const npmMessageIndex = pr.title.indexOf(npmMessagePrefix)
245+
const prVersion = npmMessageIndex === -1
246+
? null
247+
: pr.title.slice(npmMessageIndex + npmMessagePrefix.length).trim()
244248
log.silly('checking existing PR', prVersion, pr)
245249

246250
if (!existingPr && prVersion === npmVersion.toString()) {
@@ -259,7 +263,7 @@ const main = async (spec, branch = 'main', opts) => withTempDir(CWD, async (tmpD
259263
nodePrArgs,
260264
(existingPr ? ['edit', existingPr.number] : ['create', '-H', `${npmHost.user}:${npmBranch}`]),
261265
'-B', nodeBranch,
262-
'-t', npmMessage(),
266+
(existingPr ? [] : ['-t', npmMessage()]),
263267
].flat()
264268

265269
if (dryRun) {

0 commit comments

Comments
 (0)