Skip to content

fix: use env vars instead of inline expression interpolation #2

fix: use env vars instead of inline expression interpolation

fix: use env vars instead of inline expression interpolation #2

name: Auto-approve bot workflow runs

Check failure on line 1 in .github/workflows/auto-approve-bot-runs.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/auto-approve-bot-runs.yml

Invalid workflow file

`on.workflow_run` does not reference any workflows. See https://docs.github.com/actions/learn-github-actions/events-that-trigger-workflows#workflow_run for more information
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"