Resync ci_dependabot_automerge.yml with the canonical template (guidance#15) - #22
Merged
Merged
Conversation
Copies the workflow verbatim from vln-devsecops/guidance, pulling in guidance#15 (head-SHA re-check before merge, GITHUB_TOKEN dropped to read-only) and guidance#16 (gate on the PR author instead of github.actor, refuse foreign commits, fail closed when no check ever appears). Verified with guidance's tests/automerge_gate_test.sh (11/11 passing) against this repo's copy.
There was a problem hiding this comment.
Pull request overview
This PR updates the repository’s Dependabot auto-merge workflow to match the canonical vln-devsecops/guidance@main template, incorporating recent hardening changes (guidance#15/#16) for safer gating and reduced token scope under pull_request_target.
Changes:
- Reduces
GITHUB_TOKENpermissions to read-only and documents the security rationale forpull_request_target. - Fixes gating logic to key off the PR author (
github.event.pull_request.user.login) rather than the triggering actor, avoiding silent no-ops on events likereopened. - Hardens merge safety by failing closed when no sibling checks appear, re-checking PR head SHA before enabling auto-merge, and refusing PRs containing non-Dependabot-authored commits.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.github/workflows/ci_dependabot_automerge.ymlverbatim fromvln-devsecops/guidance@main, byte-identical.GITHUB_TOKENto read-only since every write already uses the PAT) and guidance#16 (gates ongithub.event.pull_request.user.logininstead ofgithub.actorso the job doesn't silently no-op onreopened; refuses PRs carrying non-Dependabot commits; fails closed instead of merging unguarded when no check ever appears).runbooks/dependabot-automerge.mdin guidance.Verification
Ran guidance's
tests/automerge_gate_test.sh(unmodified) against this repo's copy of the workflow — 11/11 passing:GITHUB_TOKENwrite scopeDEPENDABOT_AUTOMERGE_TOKENis already provisioned on this repo, so these changes take effect on merge. This repo has one other PR-triggered workflow (ci_validate_jekyll.yml) for the gate to wait on.Closes #20.
🤖 Generated with Claude Code