Skip to content

The agent engineering platform.

fix(infra): improve package section extraction regex in auto-labeling (#34724)

Mason Daughertycf5b0110554d
diff --git a/.github/workflows/auto-label-by-package.yml b/.github/workflows/auto-label-by-package.yml
index 30b53b6dfb..c634af0958 100644
--- a/.github/workflows/auto-label-by-package.yml
+++ b/.github/workflows/auto-label-by-package.yml
@@ -17,8 +17,8 @@ jobs:
script: |
const body = context.payload.issue.body || "";
- // Extract text under "### Package"
- const match = body.match(/### Package\s+([\s\S]*?)\n###/i);
+ // 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;
const packageSection = match[1].trim();