fix: gh cli needs explicit GH_TOKEN env var in gha (#21680)
This commit is contained in:
@@ -18,6 +18,8 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Find translation PR
|
- name: Find translation PR
|
||||||
id: find_pr
|
id: find_pr
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
run: |
|
run: |
|
||||||
gh pr list --repo $GITHUB_REPOSITORY --author weblate --json number,mergeable | read PR
|
gh pr list --repo $GITHUB_REPOSITORY --author weblate --json number,mergeable | read PR
|
||||||
echo "$PR" | jq '
|
echo "$PR" | jq '
|
||||||
@@ -52,7 +54,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Merge PR
|
- name: Merge PR
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
|
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
|
||||||
PR_NUMBER: ${{ steps.find_pr.outputs.PR_NUMBER }}
|
PR_NUMBER: ${{ steps.find_pr.outputs.PR_NUMBER }}
|
||||||
run: |
|
run: |
|
||||||
gh api -X POST "repos/$GITHUB_REPOSITORY/pulls/$PR_NUMBER/reviews" --field event='APPROVE' --field body='Automatically merging translations PR' \
|
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
|
- name: Wait for PR to merge
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
|
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
|
||||||
PR_NUMBER: ${{ steps.find_pr.outputs.PR_NUMBER }}
|
PR_NUMBER: ${{ steps.find_pr.outputs.PR_NUMBER }}
|
||||||
REVIEW_ID: ${{ steps.merge_pr.outputs.REVIEW_ID }}
|
REVIEW_ID: ${{ steps.merge_pr.outputs.REVIEW_ID }}
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ jobs:
|
|||||||
- name: Bot review status
|
- name: Bot review status
|
||||||
env:
|
env:
|
||||||
PR_NUMBER: ${{ github.event.pull_request.number || github.event.pull_request_review.pull_request.number }}
|
PR_NUMBER: ${{ github.event.pull_request.number || github.event.pull_request_review.pull_request.number }}
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
run: |
|
run: |
|
||||||
# Then check for APPROVED by the bot, if absent fail
|
# 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' \
|
gh pr view "$PR_NUMBER" --json reviews | jq -e '.reviews | map(select(.author.login == "github-actions[bot]" and .state == "APPROVED")) | length > 0' \
|
||||||
|
|||||||
Reference in New Issue
Block a user