From 86b5995f126664ab30a42b2faf7a6ee4afb7426d Mon Sep 17 00:00:00 2001 From: Bryan Morgan Date: Tue, 6 Jan 2026 16:00:47 -0500 Subject: [PATCH] Add workflow to label child issues for rollup (#16002) --- .../workflows/label-backlog-child-issues.yml | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/label-backlog-child-issues.yml diff --git a/.github/workflows/label-backlog-child-issues.yml b/.github/workflows/label-backlog-child-issues.yml new file mode 100644 index 0000000000..d1c085218d --- /dev/null +++ b/.github/workflows/label-backlog-child-issues.yml @@ -0,0 +1,34 @@ +name: 'Label Child Issues for Project Rollup' + +on: + issues: + types: ['opened', 'edited'] + +jobs: + labeler: + runs-on: 'ubuntu-latest' + permissions: + issues: 'write' + steps: + - name: 'Check for Parent Workstream and Apply Label' + uses: 'actions/github-script@v7' + with: + script: | + const issue = context.payload.issue; + // Define the parent workstream issue numbers + const parentWorkstreamNumbers = [15374, 15456, 15324]; + // Define the label to add + const labelToAdd = "workstream-rollup"; + + // Check if the issue has a body and a parent, and if that parent is in our list + if (issue && issue.body && issue.parent && parentWorkstreamNumbers.includes(issue.parent.number)) { + console.log(`Issue #${issue.number} is a child of a target workstream. Adding label.`); + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: issue.number, + labels: [labelToAdd] + }); + } else { + console.log(`Issue #${issue.number} is not a valid child of a target workstream or has no body. No action taken.`); + }