diff --git a/scripts/check-pr-template.mjs b/scripts/check-pr-template.mjs index eeffb4a0a..f799b41f5 100644 --- a/scripts/check-pr-template.mjs +++ b/scripts/check-pr-template.mjs @@ -29,15 +29,25 @@ try { const association = (process.env.AUTHOR_ASSOCIATION || "").toUpperCase(); const isMaintainer = ["OWNER", "MEMBER", "COLLABORATOR"].includes(association); -// Strip HTML comments in a single linear pass: remove complete `` -// blocks, then drop any leftover unterminated `/g, "") - .replace(/", start + 4); + if (end === -1) break; // unterminated comment: drop the rest + i = end + 3; + } + return out.trim(); +}; // Grab the text under a heading whose title contains `keyword`, up to the next heading // or the end of the body.