From 09afea7c35d88f19524a6b658624caabc1ac5557 Mon Sep 17 00:00:00 2001 From: tapframe <85391825+tapframe@users.noreply.github.com> Date: Sun, 14 Jun 2026 19:50:53 +0530 Subject: [PATCH] Fix needs-info log section parsing --- .github/workflows/triage-needs-info.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/triage-needs-info.yml b/.github/workflows/triage-needs-info.yml index 2bea1d46..bf699cdf 100644 --- a/.github/workflows/triage-needs-info.yml +++ b/.github/workflows/triage-needs-info.yml @@ -32,8 +32,12 @@ jobs: return labels.includes(name.toLowerCase()); } + function escapeRegExp(value) { + return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); + } + function extractSection(title) { - const re = new RegExp(`^###\\s+${title.replace(/[.*+?^${}()|[\\]\\\\]/g, "\\\\$&")}\\s*$`, "m"); + const re = new RegExp(`^###\\s+${escapeRegExp(title)}\\s*$`, "m"); const match = body.match(re); if (!match) return ""; const start = match.index + match[0].length;