Skip to content

fix: adopt canonical hardened automerge template - #2

Merged
blytkerchan merged 1 commit into
masterfrom
fix/automerge-canonical-template
Aug 3, 2026
Merged

fix: adopt canonical hardened automerge template#2
blytkerchan merged 1 commit into
masterfrom
fix/automerge-canonical-template

Conversation

@blytkerchan

Copy link
Copy Markdown
Member

This repo is auto-merging unguarded right now

.github/workflows/ci_dependabot_automerge.yml calls gh pr merge --auto --squash with nothing gating it, and DEPENDABOT_AUTOMERGE_TOKEN is provisioned here — so this is live, not latent. Minor/patch Dependabot PRs are merging without waiting for ci_validate_cmake.yml.

gh pr merge --auto does not mean "merge when CI passes"; it means "merge when the repository's merge requirements are satisfied". master has no branch protection and no required status check, so there are no requirements and it merges immediately. That is exactly how node-dashboard#37 merged past a failing plan job.

Fix

Verbatim copy of the canonical template from guidance@main. It polls the PR head commit's own check runs and blocks the merge unless every other check completed successfully — so it fails closed regardless of branch-protection config or plan tier.

ci_validate_cmake.yml gives it something real to wait on.

Do not hand-edit it: the trigger, token handling, run-id self-exclusion and settle window are each load-bearing and each was a real failure elsewhere in the portfolio. See runbooks/dependabot-automerge.md.

Found during a cross-org scan on 2026-08-03 that extended to vln-bookstore, rxmail-io, vln-sneakyimmediatetapeworm and cpp4theselftaught — orgs not covered by earlier passes.

The workflow called gh pr merge --auto with nothing gating it, and this
repo has DEPENDABOT_AUTOMERGE_TOKEN provisioned, so minor/patch bumps
were auto-merging with nothing waiting on ci_validate_cmake.yml.

Replaced with the canonical template from vln-devsecops/guidance, which
gates the merge on the PR head commit's own check runs.
Copilot AI review requested due to automatic review settings August 3, 2026 15:30

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 replaces the repository’s Dependabot auto-merge workflow with a hardened canonical template that prevents unguarded merges when the default branch has no required status checks configured. It implements a “fail closed” gate by polling the PR head commit’s check runs and only enabling auto-merge when all other checks have completed successfully.

Changes:

  • Adds an explicit “wait for other checks” gate based on the head SHA’s check runs (with self-run exclusion and time bounds).
  • Makes auto-merge opt-in by requiring DEPENDABOT_AUTOMERGE_TOKEN (no GITHUB_TOKEN fallback) and emits a notice when not provisioned.
  • Updates permissions and trigger types to support reading checks and running on Dependabot PR activity.

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

@blytkerchan
blytkerchan merged commit c9fd1a9 into master Aug 3, 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.

2 participants