From b62d9a22fbab05be9b6fdb473d89fc2fd9fe4c1d Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sun, 4 May 2025 17:05:00 +0200 Subject: [PATCH] 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 --- .github/workflows/backport.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index bbc18fdeebeab..56ee11e726b63 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -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