Skip to content

The agent engineering platform.

ci: match both `h2` and `h3` area headings in auto-labeler (#36572)

Mason Daugherty642c981d70ee
diff --git a/.github/workflows/auto-label-by-package.yml b/.github/workflows/auto-label-by-package.yml
index 0a4ed67c0c..a9dfd65168 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();