From 642c981d70ee561a0aebb93a4f8a5e937174ec55 Mon Sep 17 00:00:00 2001 From: Mason Daugherty Date: Mon, 6 Apr 2026 15:41:20 -0400 Subject: [PATCH] ci: match both `h2` and `h3` area headings in auto-labeler (#36572) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GitHub issue forms render the "Area (Required)" field label at inconsistent heading levels — some issues get `### Area` (h3), others get `## Area` (h2). The `auto-label-by-package` workflow's regex was hardcoded to `### Area`, silently skipping issues with `## Area` headings and never applying package labels (e.g. [#2471](https://github.com/langchain-ai/deepagents/issues/2471)). --- .github/workflows/auto-label-by-package.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/auto-label-by-package.yml b/.github/workflows/auto-label-by-package.yml index 0a4ed67c0ca..a9dfd651685 100644 --- a/.github/workflows/auto-label-by-package.yml +++ b/.github/workflows/auto-label-by-package.yml @@ -20,9 +20,15 @@ jobs: script: | const body = context.payload.issue.body || ""; - // Extract text under "### Package" (handles " (Required)" suffix and being last section) - const match = body.match(/### Package[^\n]*\n([\s\S]*?)(?:\n###|$)/i); - if (!match) return; + // Extract text under "## Package" or "### Package" (handles " (Required)" suffix and being last section) + const match = body.match(/#{2,3} Package[^\n]*\n([\s\S]*?)(?:\n#{2,3} |$)/i); + if (!match) { + core.setFailed( + `Could not find "## Package" section in issue #${context.issue.number} body. ` + + `The issue template may have changed — update the regex in this workflow.` + ); + return; + } const packageSection = match[1].trim();