Uh oh!
There was an error while loading. Please reload this page.
fix: use pull_request_target so vuln-gate/auto-merge work on real Dependabot PRs - #142
Conversation
…endabot PRs GitHub treats Dependabot-authored PRs like fork PRs for secrets purposes: a plain pull_request trigger gets no repository secrets and a read-only GITHUB_TOKEN regardless of the permissions: block requested. Since both of these workflows exist specifically to react to Dependabot's own PRs (dependabot-auto-merge.yml's jobs are gated on github.actor == 'dependabot[bot]' outright), this silently broke them for their actual primary purpose across every repo they've been rolled out to -- confirmed live on avtr-field-mobile, where all 17 real Dependabot PRs failed with 'missing dependabot-alerts-token' while PRs authored by a human passed cleanly. pull_request_target evaluates the workflow file from the trusted base branch, restoring real secrets/write-token access. Safe here specifically because neither workflow ever checks out or executes the PR's own code -- critical-vuln-check.yml's job is a pure Dependabot Alerts API query, and dependabot-auto-merge.yml's auto-merge job only reads PR metadata via the API and calls gh pr merge by URL.
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: simplify9/coderabbit/.coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📜 Recent review details🔇 Additional comments (2)
📝 WalkthroughSummary
Risk: Security-sensitive areas
Test coverage impact
Operational concerns
WalkthroughBoth workflow templates now trigger on ChangesDependabot workflow triggers
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
GitHub treats Dependabot-authored PRs like fork PRs for secrets purposes: a plain
pull_requesttrigger gets no repository secrets and a read-onlyGITHUB_TOKEN, regardless of thepermissions:block requested. Since bothcritical-vuln-check.ymlanddependabot-auto-merge.ymlexist specifically to react to Dependabot's own PRs, this silently broke them for their actual primary purpose across the whole org-wide rollout — confirmed live on AVTR-Recycling-Treatment/avtr-field-mobile, where all 17 real Dependabot PRs failed with "missing dependabot-alerts-token" while PRs authored by a human passed cleanly.Switches both templates to
pull_request_target, which evaluates the workflow file from the trusted base branch, restoring real secrets/write-token access. Verified live: reopened a real Dependabot PR on avtr-field-mobile after applying this fix there —vuln-gate / checknow passes (was previously failing on that same PR).Safe from the usual
pull_request_targetrisk (a workflow checking out and running the PR's own code with elevated secrets) because neither workflow ever does that —critical-vuln-check.yml's job is a pure Dependabot Alerts API query, anddependabot-auto-merge.yml's auto-merge job only reads PR metadata via the API and callsgh pr mergeby URL.