Skip to content

Commit 16086c8

Browse files
committed
fix(github): use pull_request_target for dependabot automerge workflow
The pull_request trigger runs Dependabot PRs with a read-only token (GitHub's post-2021 fork security model), causing `gh pr merge` to silently fail or be skipped. Switching to pull_request_target runs the workflow in the base branch context with write permissions. The github.actor == 'dependabot[bot]' guard makes this safe — Dependabot never modifies base-branch code.
1 parent d0ea003 commit 16086c8

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

.github/workflows/automerge.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Auto-merge Dependabot
22

33
on:
4-
pull_request:
4+
pull_request_target:
55
types: [opened, synchronize, reopened, ready_for_review]
66

77
permissions:
@@ -18,7 +18,6 @@ env:
1818
jobs:
1919
automerge:
2020
runs-on: ubuntu-latest
21-
# Only run for Dependabot PRs where CI has passed
2221
if: github.actor == 'dependabot[bot]'
2322
steps:
2423
- name: Fetch Dependabot metadata

0 commit comments

Comments
 (0)