diff --git a/.github/scripts/issue-version-triage.cjs b/.github/scripts/issue-version-triage.cjs index 1c9a8215e..5ffb84f5e 100644 --- a/.github/scripts/issue-version-triage.cjs +++ b/.github/scripts/issue-version-triage.cjs @@ -17,10 +17,13 @@ function escapeRegExp(value) { return String(value || "").replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); } -function extractSectionValue(body, heading) { +function extractSectionValue(body, heading, followingHeadings = []) { if (!body) return null; + const boundary = followingHeadings.length + ? followingHeadings.map(escapeRegExp).join("|") + : "[^\\n]+"; const pattern = new RegExp( - `^#+\\s*${escapeRegExp(heading)}\\s*$\\n+([\\s\\S]*?)(?=^#+\\s+|$)`, + `^#+\\s*${escapeRegExp(heading)}\\s*$\\n+([\\s\\S]*?)(?=^#+\\s*(?:${boundary})\\s*$|$)`, "im" ); const match = body.match(pattern); @@ -40,7 +43,12 @@ function stripHTMLComments(value) { } function classifyAdditionalActionableTopics(body) { - const value = extractSectionValue(body, "Additional actionable topics"); + const value = extractSectionValue(body, "Additional actionable topics", [ + "Pulse version", + "Additional context", + "Logs, screenshots, or diagnostics", + "Confirmations", + ]); if (value === null) return null; const normalized = stripHTMLComments(value) diff --git a/.github/scripts/issue-version-triage.test.cjs b/.github/scripts/issue-version-triage.test.cjs index 6e061172b..d86b8f094 100644 --- a/.github/scripts/issue-version-triage.test.cjs +++ b/.github/scripts/issue-version-triage.test.cjs @@ -199,6 +199,19 @@ test("additional topic classification is explicit and fail-quiet for legacy form ), true ); + assert.equal( + classifyAdditionalActionableTopics( + [ + "### Additional actionable topics", + "### 2. Proxmox VE Agent Install Command", + "The generated command should expose its security controls.", + "", + "### Pulse version", + "v6.4.1", + ].join("\n") + ), + true + ); }); test("every actionable issue form exposes the decomposition signal", () => {