From b65126fa71e744c53fbae44d90139d3069711ac4 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Fri, 30 May 2025 19:26:52 -0500 Subject: [PATCH] ci: fix backport if condition (#7167) Can't access secrets from if condition. Signed-off-by: Austin Horstman --- .github/workflows/backport.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index ef7fd2335..17297a998 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -16,15 +16,19 @@ jobs: backport: name: Backport Pull Request if: > - secrets.GH_TOKEN_FOR_UPDATES - && github.event.pull_request.merged == true - && ( - github.event.action != 'labeled' + 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 }}