From 6d09fd37a7d4110251c1c03cb09fbf6321fbe10d Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Sat, 31 May 2025 02:28:34 +0100 Subject: [PATCH] ci: alternative fix for backport if condition (#7169) Can't access secrets from if condition, so we'll explicitly check this isn't a fork. --- .github/workflows/backport.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 17297a99..65586f4d 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -16,19 +16,15 @@ jobs: backport: name: Backport Pull Request if: > - github.event.pull_request.merged == true && - ( github.event.action != 'labeled' + github.repository_owner == 'nix-community' + && github.event.pull_request.merged == true + && ( + github.event.action != 'labeled' || startsWith(github.event.label.name, 'backport') ) runs-on: ubuntu-24.04-arm steps: - - name: Check token - run: | - if [ -z "${{ secrets.GH_TOKEN_FOR_UPDATES }}" ]; then - echo "GH_TOKEN_FOR_UPDATES secret is not set" - exit 1 - fi - uses: actions/checkout@v4 with: token: ${{ secrets.GH_TOKEN_FOR_UPDATES }}