From 9d373654ac77cf891f44725d7f59a4ed4afc7900 Mon Sep 17 00:00:00 2001 From: Drew Smirnoff Date: Sun, 3 May 2026 13:54:41 +0400 Subject: [PATCH] ci: add labeler configuration for PRs (#1224) --- .github/labeler-config-pr.yml | 27 +++++++++++++++++++++++++++ .github/workflows/labeler.yml | 12 +++++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 .github/labeler-config-pr.yml diff --git a/.github/labeler-config-pr.yml b/.github/labeler-config-pr.yml new file mode 100644 index 0000000000000000000000000000000000000000..68bff158785f3f4e78d4b5a311fc340965f9b6ef --- /dev/null +++ b/.github/labeler-config-pr.yml @@ -0,0 +1,27 @@ +# Keyword labels for PRs only. No area/* (paths handle those via pr-paths.yml). + +"bug": '\b([Bb]ug(s)?|[Ff]ix(es)?)\b' + +"enhancement": '\b([Ff]eat(s)?)\b' + +"documentation": '\b([Dd]ocumentation|[Dd]ocs|[Rr]eadme)\b' + +"question": '\b([Qq]uestion(s)?|[Hh]elp|[Hh]ow to)\b' + +"performance": '\b([Pp]erformance|[Oo]ptimiz(e|ation)|[Ss]peed|[Ee]fficiency)\b' + +"dependencies": '([Cc]hore\(deps\)|[Ff]ix\(deps\))' + +"ci": '\b([Cc]i|[Cc]ontinuous integration|[Bb]uild|[Ww]orkflow)\b' + +"chore": '\b([Cc]hore|[Mm]aintenance|[Rr]efactor|[Cc]leanup)\b' + +"os/windows": '\b([Ww]indows|[Ww]in(10|11)|[Mm]icrosoft)\b' + +"os/linux": '\b([Ll]inux|[Uu]buntu|[Dd]ebian|[Ff]edora|[Aa]rch [Ll]inux|[Nn]ix[Oo][Ss]|[Pp]op!?_?[Oo][Ss])\b' + +"os/macos": '\b([Mm]ac[Oo][Ss]?|[Oo][Ss] ?[Xx]|[Dd]arwin|[Mm]acbook)\b' + +"arch/arm64": '\b(arm64|aarch64|[Aa]pple ?[Ss]ilicon|[Mm][1-4]( [Pp]ro| [Mm]ax| [Uu]ltra)?|[Mm]ac(book)? [Mm][1-4])\b' + +"arch/amd64": '\b(amd64|x86[_-]?64|x64|[Ii]ntel( [Mm]ac)?)\b' diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 136af89d4ce0435b8a896ba0ab97cfa51d20e023..41f13e873431181b23e5ac776daf2d86db849270 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -20,10 +20,20 @@ jobs: steps: - uses: actions/checkout@v6 - - name: Apply Labels + - name: Apply Labels (issues — includes area/*) + if: github.event_name == 'issues' uses: github/issue-labeler@v3.4 with: repo-token: "${{ secrets.HOMEBREW_GITHUB_TOKEN }}" configuration-path: .github/labeler-config.yml enable-versioned-regex: 0 include-title: 1 + + - name: Apply Labels (PRs — no area/*, paths handle those) + if: github.event_name == 'pull_request_target' + uses: github/issue-labeler@v3.4 + with: + repo-token: "${{ secrets.HOMEBREW_GITHUB_TOKEN }}" + configuration-path: .github/labeler-config-pr.yml + enable-versioned-regex: 0 + include-title: 1