From 4e7835cdf6e0df2c9751b40b9dce924d4cc9285d Mon Sep 17 00:00:00 2001 From: GigaHierz Date: Tue, 18 Aug 2026 01:08:02 +0100 Subject: [PATCH 1/2] ci: auto-label issue priority from the form dropdown Co-Authored-By: Claude Fable 5 --- .github/workflows/issue-priority-label.yml | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/issue-priority-label.yml diff --git a/.github/workflows/issue-priority-label.yml b/.github/workflows/issue-priority-label.yml new file mode 100644 index 000000000..7a40b44c4 --- /dev/null +++ b/.github/workflows/issue-priority-label.yml @@ -0,0 +1,39 @@ +# Copy to /.github/workflows/issue-priority-label.yml (apply.sh does this). +# Turns the issue form's required "Priority" dropdown into the matching priority:* label, +# so every ticket carries its priority as a label from the moment it's filed. +# Uses only the repo-scoped GITHUB_TOKEN — no secrets to configure. +name: Label issue priority + +on: + issues: + types: [opened, edited] + +permissions: + issues: write + +jobs: + label: + runs-on: ubuntu-latest + steps: + - name: Apply priority label from the form dropdown + env: + GH_TOKEN: ${{ github.token }} + BODY: ${{ github.event.issue.body }} + NUM: ${{ github.event.issue.number }} + REPO: ${{ github.repository }} + run: | + # The dropdown renders as "### Priority..." followed by the selected option; + # options may carry a description ("critical — money correctness ..."), so + # only the first word is the priority. + p=$(printf '%s\n' "$BODY" \ + | awk '/^### Priority/{found=1; next} found && NF {print tolower($1); exit}' \ + | tr -d '\r') + case "$p" in + critical|high|medium|low) ;; + *) echo "no priority selection found (got: '$p') — nothing to do"; exit 0 ;; + esac + for other in critical high medium low; do + [ "$other" != "$p" ] && gh issue edit "$NUM" -R "$REPO" --remove-label "priority:$other" 2>/dev/null || true + done + gh issue edit "$NUM" -R "$REPO" --add-label "priority:$p" + echo "labeled #$NUM priority:$p" From ad098c0692872c1b72a2053f6e8865067af1379c Mon Sep 17 00:00:00 2001 From: GigaHierz Date: Tue, 18 Aug 2026 01:35:42 +0100 Subject: [PATCH 2/2] ci: labeler also applies size:S/M/L from the Size dropdown Co-Authored-By: Claude Fable 5 --- .github/workflows/issue-priority-label.yml | 35 ++++++++++++++-------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/.github/workflows/issue-priority-label.yml b/.github/workflows/issue-priority-label.yml index 7a40b44c4..f07b8cc3d 100644 --- a/.github/workflows/issue-priority-label.yml +++ b/.github/workflows/issue-priority-label.yml @@ -22,18 +22,27 @@ jobs: NUM: ${{ github.event.issue.number }} REPO: ${{ github.repository }} run: | - # The dropdown renders as "### Priority..." followed by the selected option; - # options may carry a description ("critical — money correctness ..."), so - # only the first word is the priority. - p=$(printf '%s\n' "$BODY" \ - | awk '/^### Priority/{found=1; next} found && NF {print tolower($1); exit}' \ - | tr -d '\r') + # Dropdowns render as "###