From 5acf90923572fe59fb91347e4450039ecf8dde19 Mon Sep 17 00:00:00 2001 From: bo0tzz Date: Mon, 8 Sep 2025 16:48:08 +0200 Subject: [PATCH] fix: gh cli needs explicit GH_TOKEN env var in gha (#21680) --- .github/workflows/merge-translations.yml | 6 ++++-- .github/workflows/weblate-lock.yml | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/merge-translations.yml b/.github/workflows/merge-translations.yml index 9c9f6a4ce7..89a20290a9 100644 --- a/.github/workflows/merge-translations.yml +++ b/.github/workflows/merge-translations.yml @@ -18,6 +18,8 @@ jobs: steps: - name: Find translation PR id: find_pr + env: + GH_TOKEN: ${{ github.token }} run: | gh pr list --repo $GITHUB_REPOSITORY --author weblate --json number,mergeable | read PR echo "$PR" | jq ' @@ -52,7 +54,7 @@ jobs: - name: Merge PR env: - GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} + GH_TOKEN: ${{ steps.generate_token.outputs.token }} PR_NUMBER: ${{ steps.find_pr.outputs.PR_NUMBER }} run: | gh api -X POST "repos/$GITHUB_REPOSITORY/pulls/$PR_NUMBER/reviews" --field event='APPROVE' --field body='Automatically merging translations PR' \ @@ -62,7 +64,7 @@ jobs: - name: Wait for PR to merge env: - GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} + GH_TOKEN: ${{ steps.generate_token.outputs.token }} PR_NUMBER: ${{ steps.find_pr.outputs.PR_NUMBER }} REVIEW_ID: ${{ steps.merge_pr.outputs.REVIEW_ID }} run: | diff --git a/.github/workflows/weblate-lock.yml b/.github/workflows/weblate-lock.yml index 4ff1b78576..298215fb1a 100644 --- a/.github/workflows/weblate-lock.yml +++ b/.github/workflows/weblate-lock.yml @@ -36,6 +36,7 @@ jobs: - name: Bot review status env: PR_NUMBER: ${{ github.event.pull_request.number || github.event.pull_request_review.pull_request.number }} + GH_TOKEN: ${{ github.token }} run: | # Then check for APPROVED by the bot, if absent fail gh pr view "$PR_NUMBER" --json reviews | jq -e '.reviews | map(select(.author.login == "github-actions[bot]" and .state == "APPROVED")) | length > 0' \