From 2fa56fe2d3e842edd23230b2bd73913de4bc1dd7 Mon Sep 17 00:00:00 2001 From: reggi Date: Mon, 24 Aug 2026 16:35:35 -0400 Subject: [PATCH] fix: recognize prefixed Node.js PR titles Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 14a9626a-4d0e-4be3-b06c-b6676ecb3895 --- scripts/create-node-pr.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/create-node-pr.js b/scripts/create-node-pr.js index c75647ffd0669..fd7ebe816b5f5 100644 --- a/scripts/create-node-pr.js +++ b/scripts/create-node-pr.js @@ -238,9 +238,13 @@ const main = async (spec, branch = 'main', opts) => withTempDir(CWD, async (tmpD let existingPr = null const closePrs = [] + const npmMessagePrefix = npmMessage('') for (const pr of npmPrs) { - const prVersion = pr.title.replace(npmMessage(''), '').trim() + const npmMessageIndex = pr.title.indexOf(npmMessagePrefix) + const prVersion = npmMessageIndex === -1 + ? null + : pr.title.slice(npmMessageIndex + npmMessagePrefix.length).trim() log.silly('checking existing PR', prVersion, pr) if (!existingPr && prVersion === npmVersion.toString()) { @@ -259,7 +263,7 @@ const main = async (spec, branch = 'main', opts) => withTempDir(CWD, async (tmpD nodePrArgs, (existingPr ? ['edit', existingPr.number] : ['create', '-H', `${npmHost.user}:${npmBranch}`]), '-B', nodeBranch, - '-t', npmMessage(), + (existingPr ? [] : ['-t', npmMessage()]), ].flat() if (dryRun) {