Skip to content

Commit f70503a

Browse files
philipbalinovclaude
andcommitted
Add workflow to auto-approve bot workflow runs
GitHub now requires maintainer approval for workflows triggered by bot-authored events (github-actions[bot], dependabot[bot]). This companion workflow listens for workflow_run requests in action_required state and auto-approves them for trusted bot actors. Ref: https://github.blog/changelog/2025-04-15-upcoming-breaking-changes-and-releases-for-github-actions/ Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e1bac20 commit f70503a

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Auto-approve bot workflow runs
2+
3+
on:
4+
# workflow_run runs in the context of the default branch,
5+
# so it is not itself subject to the approval gate.
6+
workflow_run:
7+
types: [requested]
8+
9+
permissions:
10+
actions: write
11+
12+
jobs:
13+
approve:
14+
runs-on: ubuntu-latest
15+
if: >-
16+
github.event.workflow_run.conclusion == 'action_required' &&
17+
contains(fromJSON('["github-actions[bot]","dependabot[bot]"]'), github.event.workflow_run.actor.login)
18+
steps:
19+
- name: Approve workflow run
20+
env:
21+
GH_TOKEN: ${{ github.token }}
22+
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 }}

0 commit comments

Comments
 (0)