From 19095200155c0164eeb1629d3ad5f2a53ad40e15 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sun, 27 Apr 2025 20:14:00 +0200 Subject: [PATCH 1/2] workflows/labels: skip for staging-next / haskell-updates / python-updates Labelling those PRs is more annoying then useful. --- .github/labeler-protected-branches.yml | 12 ++++++++++++ .github/workflows/labels.yml | 11 +++++++++++ 2 files changed, 23 insertions(+) create mode 100644 .github/labeler-protected-branches.yml diff --git a/.github/labeler-protected-branches.yml b/.github/labeler-protected-branches.yml new file mode 100644 index 0000000000000..9e2af0e06bdeb --- /dev/null +++ b/.github/labeler-protected-branches.yml @@ -0,0 +1,12 @@ +# This file is used by .github/workflows/labels.yml +# This version is only run for Pull Requests from protected branches like staging-next, haskell-updates or python-updates. + +"6.topic: haskell": + - any: + - head-branch: + - '^haskell-updates$' + +"6.topic: python": + - any: + - head-branch: + - '^python-updates$' diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index 0ae4ee09d5ca7..4aefb306c0489 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -20,12 +20,23 @@ jobs: if: "github.repository_owner == 'NixOS' && !contains(github.event.pull_request.title, '[skip treewide]')" steps: - uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0 + if: "!(github.pull_request.head.repo == 'NixOS' && github.ref_protected)" with: repo-token: ${{ secrets.GITHUB_TOKEN }} configuration-path: .github/labeler.yml # default sync-labels: true - uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0 + if: "!(github.pull_request.head.repo == 'NixOS' && github.ref_protected)" with: repo-token: ${{ secrets.GITHUB_TOKEN }} configuration-path: .github/labeler-no-sync.yml sync-labels: false + - uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0 + # Protected branches like staging-next, haskell-updates and python-updates get special labels. + # This is to avoid the mass of labels there, which is mostly useless - and really annoying for + # the backport labels. + if: "github.pull_request.head.repo == 'NixOS' && github.ref_protected" + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + configuration-path: .github/labeler-protected-branches.yml + sync-labels: true From 5ed0205f6a9f6b1939c5b9caf835c368b578fb62 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Fri, 2 May 2025 19:26:17 +0200 Subject: [PATCH 2/2] labels: add workflow related labels This adds some labels related to the higher level workflows of developing nixpkgs: - "4.workflow: backport" can be used to filter everything targeting the stable branches, both release-XX.YY or staging-XX.YY. - "4.workflow: package set updates" can be used to filter the haskell/python package set PRs. Can be combined with "6.topic: haskell" or "6.topic: python". - "4.workflow: staging" can be used to filter for all staging-next PRs, both to master and release branches. --- .github/labeler-protected-branches.yml | 11 +++++++++++ .github/labeler.yml | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/.github/labeler-protected-branches.yml b/.github/labeler-protected-branches.yml index 9e2af0e06bdeb..b8c0af693338b 100644 --- a/.github/labeler-protected-branches.yml +++ b/.github/labeler-protected-branches.yml @@ -1,6 +1,17 @@ # This file is used by .github/workflows/labels.yml # This version is only run for Pull Requests from protected branches like staging-next, haskell-updates or python-updates. +"4.workflow: package set update": + - any: + - head-branch: + - '-updates$' + +"4.workflow: staging": + - any: + - head-branch: + - '^staging-next$' + - '^staging-next-' + "6.topic: haskell": - any: - head-branch: diff --git a/.github/labeler.yml b/.github/labeler.yml index 78bfb4483c2be..ef7483d6e20bf 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -3,6 +3,12 @@ # keep-sorted start case=no numeric=yes newline_separated=yes skip_lines=1 +"4.workflow: backport": + - any: + - base-branch: + - '^release-' + - '^staging-' + # NOTE: bsd, darwin and cross-compilation labels are handled by ofborg "6.topic: agda": - any: