Unverified Commit b62d9a22 authored by Wolfgang Walther's avatar Wolfgang Walther
Browse files

workflows/backport: only trigger on backport labels

The backport job was previously triggered on any label activity, i.e.
when the backport label was already set and a new label added, the
backport would have been triggered again.

That's because github.event_name is actually "pull_request_target" in
this case, not "closed" or "labeled" (the event's types). Thus, this
part of the condition was always true.

This also means that the second part, the startsWith, was never
evaluated. It had its arguments flipped and would have always been
false.

This was introduced in #126825, but has never really worked as intended.

Resolves #199556
parent 5c44d1cf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ permissions: {}
jobs:
  backport:
    name: Backport Pull Request
    if: github.repository_owner == 'NixOS' && github.event.pull_request.merged == true && (github.event_name != 'labeled' || startsWith('backport', github.event.label.name))
    if: github.repository_owner == 'NixOS' && github.event.pull_request.merged == true && (github.pull_request.action != 'labeled' || startsWith(github.event.label.name, 'backport'))
    runs-on: ubuntu-24.04
    steps:
      # Use a GitHub App to create the PR so that CI gets triggered