From 50722531ca5ca0374d3f44dda03d9eb2d2e7009c Mon Sep 17 00:00:00 2001 From: Chris Parsons <438676+chrisparsons83@users.noreply.github.com> Date: Tue, 10 Mar 2026 13:40:44 -0700 Subject: [PATCH] Create label-subissues.yaml --- .github/workflows/label-subissues.yaml | 35 ++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/label-subissues.yaml diff --git a/.github/workflows/label-subissues.yaml b/.github/workflows/label-subissues.yaml new file mode 100644 index 0000000..fb67e66 --- /dev/null +++ b/.github/workflows/label-subissues.yaml @@ -0,0 +1,35 @@ +name: Label Subissues +on: + issues: + types: [opened, edited] + +jobs: + apply-label: + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: Check for Parent and Label + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ISSUE_NODE_ID: ${{ github.event.issue.node_id }} + run: | + # Use GraphQL to check if this issue has a parent + PARENT_ID=$(gh api graphql -f query=' + query($id: ID!) { + node(id: $id) { + ... on Issue { + parent { + id + } + } + } + }' -f id=$ISSUE_NODE_ID --jq '.data.node.parent.id') + + # If PARENT_ID is not null, it is a subissue + if [ "$PARENT_ID" != "null" ] && [ -n "$PARENT_ID" ]; then + echo "Subissue detected. Applying label..." + gh issue edit ${{ github.event.issue.number }} --add-label "subissue" + else + echo "This is a top-level issue." + fi