Skip to content

Resync ci_dependabot_automerge.yml with the canonical template (guidance#15) - #4

Merged
blytkerchan merged 1 commit into
masterfrom
resync-automerge-gate-issue-3
Aug 4, 2026
Merged

Resync ci_dependabot_automerge.yml with the canonical template (guidance#15)#4
blytkerchan merged 1 commit into
masterfrom
resync-automerge-gate-issue-3

Conversation

@blytkerchan

Copy link
Copy Markdown
Member

Summary

  • Copies .github/workflows/ci_dependabot_automerge.yml verbatim from vln-devsecops/guidance@main, byte-identical.
  • Pulls in guidance#15 (re-checks the PR head SHA before merging so a run never enables auto-merge for a commit it didn't gate; drops GITHUB_TOKEN to read-only since every write already uses the PAT) and guidance#16 (gates on github.event.pull_request.user.login instead of github.actor so the job doesn't silently no-op on reopened; refuses PRs carrying non-Dependabot commits; fails closed instead of merging unguarded when no check ever appears).
  • No hand-merging: the file is a straight copy, per runbooks/dependabot-automerge.md in guidance.

Verification

Ran guidance's tests/automerge_gate_test.sh (unmodified) against this repo's copy of the workflow — 11/11 passing:

  • template/policy checks: PAT opt-in enforced, no GITHUB_TOKEN write scope
  • gate behaviour: all-pass, a-failure, a-cancellation, a-still-running sibling, failure on a paginated API response, a sibling that never completes
  • the two regressions this gate exists to prevent: the job's own in-progress check run doesn't self-block, and a late-registering sibling is still caught (the node-dashboard#37 shape)
  • no-siblings-at-all is refused (fail closed) rather than merged unguarded

DEPENDABOT_AUTOMERGE_TOKEN is already provisioned on this repo, so these changes take effect on merge. This repo has one other PR-triggered workflow (ci_validate_cmake.yml) for the gate to wait on.

Closes #3.

🤖 Generated with Claude Code

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.
Copilot AI lite review requested due to automatic review settings August 4, 2026 22:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR resyncs the repository’s Dependabot auto-merge workflow to match the canonical vln-devsecops/guidance@main template, incorporating the gating and safety fixes from guidance#15/#16 for pull_request_target-based auto-merge.

Changes:

  • Reduces GITHUB_TOKEN permissions to read-only while continuing to use the PAT (DEPENDABOT_AUTOMERGE_TOKEN) for all write operations.
  • Fixes Dependabot detection to use the PR author (github.event.pull_request.user.login) and adds explicit protection against non-Dependabot commits.
  • Strengthens gating behavior: fails closed when no sibling checks appear, and re-validates the PR head SHA immediately before enabling auto-merge.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@blytkerchan
blytkerchan merged commit 2198a5b into master Aug 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resync ci_dependabot_automerge.yml with the canonical template (guidance#15)

2 participants