Skip to content

Commit 811b17b

Browse files
philipbalinovclaude
andcommitted
fix: use env vars instead of inline expression interpolation
Avoid script injection by passing workflow_run event fields through env: rather than interpolating ${{ }} directly in the shell script. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f70503a commit 811b17b

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ jobs:
1919
- name: Approve workflow run
2020
env:
2121
GH_TOKEN: ${{ github.token }}
22+
RUN_ID: ${{ github.event.workflow_run.id }}
23+
ACTOR: ${{ github.event.workflow_run.actor.login }}
24+
REPO: ${{ github.repository }}
2225
run: |
23-
echo "Approving run ${{ github.event.workflow_run.id }} triggered by ${{ github.event.workflow_run.actor.login }}"
24-
gh run approve ${{ github.event.workflow_run.id }} --repo ${{ github.repository }}
26+
echo "Approving run $RUN_ID triggered by $ACTOR"
27+
gh run approve "$RUN_ID" --repo "$REPO"

0 commit comments

Comments
 (0)