From 343aab985a0248ef86f38d7f0198e70a4942feed Mon Sep 17 00:00:00 2001 From: Michael Kubacki Date: Wed, 15 Jan 2025 17:02:10 -0500 Subject: [PATCH] update --- .github/workflows/issue-triage.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/issue-triage.yml b/.github/workflows/issue-triage.yml index c0e4b728de..176b683a15 100644 --- a/.github/workflows/issue-triage.yml +++ b/.github/workflows/issue-triage.yml @@ -69,10 +69,13 @@ jobs: }); const issueLines = issue.data.body.split('\n'); - const packagesLine = issueLines.find(line => line.includes('packages_impacted')); - const packagesImpacted = packagesLine.split(': ')[1].trim(); - const packagesToPrepend = packagesImpacted.split(',').map(pkg => `[${pkg.trim()}]`).join(' ') - const newTitle = `${packagesToPrepend} - ${issue.data.title}`; + const packageLineIndex = issueLines.findIndex(line => line.includes('What packages are impacted?')); + if (packageLineIndex === -1) { + process.exit(0); + } + const packagesImpacted = issueLines[packageLineIndex + 2] : ''; + const packagesToAppend = packagesImpacted.split(',').map(pkg => `[${pkg.trim()}]`).join(' '); + const newTitle = `${issue.data.title} - ${packagesToAppend}`; await github.rest.issues.update({ owner: context.repo.owner,