fix: use env vars instead of inline expression interpolation #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Auto-approve bot workflow runs | ||
|
Check failure on line 1 in .github/workflows/auto-approve-bot-runs.yml
|
||
| on: | ||
| # workflow_run runs in the context of the default branch, | ||
| # so it is not itself subject to the approval gate. | ||
| workflow_run: | ||
| types: [requested] | ||
| permissions: | ||
| actions: write | ||
| jobs: | ||
| approve: | ||
| runs-on: ubuntu-latest | ||
| if: >- | ||
| github.event.workflow_run.conclusion == 'action_required' && | ||
| contains(fromJSON('["github-actions[bot]","dependabot[bot]"]'), github.event.workflow_run.actor.login) | ||
| steps: | ||
| - name: Approve workflow run | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| RUN_ID: ${{ github.event.workflow_run.id }} | ||
| ACTOR: ${{ github.event.workflow_run.actor.login }} | ||
| REPO: ${{ github.repository }} | ||
| run: | | ||
| echo "Approving run $RUN_ID triggered by $ACTOR" | ||
| gh run approve "$RUN_ID" --repo "$REPO" | ||