workflows/labeler: fix conditionals (#404152)

Changed files
+23 -5
.github
+1 -1
.github/labeler-protected-branches.yml .github/labeler-development-branches.yml
···
# 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.
+
# This version is only run for Pull Requests from development branches like staging-next, haskell-updates or python-updates.
"4.workflow: package set update":
- any:
+22 -4
.github/workflows/labels.yml
···
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)"
+
if: |
+
github.event.pull_request.head.repo.owner.login != 'NixOS' || !(
+
github.head_ref == "haskell-updates" ||
+
github.head_ref == "python-updates" ||
+
github.head_ref == "staging-next" ||
+
startsWith(github.head_ref, "staging-next-")
+
)
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)"
+
if: |
+
github.event.pull_request.head.repo.owner.login != 'NixOS' || !(
+
github.head_ref == "haskell-updates" ||
+
github.head_ref == "python-updates" ||
+
github.head_ref == "staging-next" ||
+
startsWith(github.head_ref, "staging-next-")
+
)
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.
+
# Development 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"
+
if: |
+
github.event.pull_request.head.repo.owner.login == 'NixOS' && (
+
github.head_ref == "haskell-updates" ||
+
github.head_ref == "python-updates" ||
+
github.head_ref == "staging-next" ||
+
startsWith(github.head_ref, "staging-next-")
+
)
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/labeler-protected-branches.yml