Skip to content
Rush Commerce
Software & Dev3 min read

GitHub can now block a merge when a secret leaks

A new GitHub ruleset blocks pull requests from merging while they carry open secret scanning alerts — the gate most teams have been enforcing with a code review habit.

GitHub shipped a ruleset that blocks a pull request from merging when it introduces a secret. It went into public preview on September 9, and it closes a gap most teams have been covering with a reviewer's attention span.

What actually happened

The new rule is called require secret scanning alerts are resolved. Before a merge is allowed, it checks two things: that a secret scan has completed for the head commit, and that no open alerts exist for secrets introduced by the pull request's commits. Fail either check and the merge button is off.

By default it blocks on secrets matched by provider patterns — the ones with a known shape, like an AWS key or a Stripe token. Custom and generic pattern categories can be switched on separately, which is the right default: generic patterns are noisier, and a merge gate that cries wolf gets bypassed within a week.

Developers without bypass permission have to resolve each alert to clear the block. The rule applies at repository, organization, or enterprise level and requires GitHub Secret Protection or GitHub Advanced Security.

GitHub shipped it alongside two other September 9 items: agentic autofix for Code Quality findings, which lets you assign up to 25 findings to Copilot in one action and get a validated pull request back, and CodeQL 2.27.0.

Why a merge gate for secrets matters for your business

Push protection has existed for a while. It catches the secret on the way in. What it does not catch is the secret that arrived some other way — a commit pushed before protection was enabled, a bypass someone took on a Friday, a key that only became detectable when GitHub added the pattern.

The distinction matters because of what a leaked key costs on a clock. Once a credential lands in a merged commit on your default branch, you are not fixing a file. You are rotating the key, redeploying everything that used it, and reading logs to find out whether anyone got there first. Automated scrapers hit new public commits in seconds. Even on a private repo, the credential now lives in history forever, visible to every contractor you ever onboard.

Two configuration notes if you turn this on:

Start with provider patterns only. They have low false-positive rates and unambiguous remediation. Add generic patterns after you know your alert volume.

Decide who gets bypass, and log it. A gate with a wide bypass list is a suggestion. A gate with a bypass list of two people and an audit trail is a control.

The rule is not a substitute for keeping secrets out of code. It is the backstop for the day someone does it anyway — which, on a long enough timeline, is every team.

Key takeaways

  • GitHub's "require secret scanning alerts are resolved" ruleset entered public preview on September 9, 2026
  • It blocks a merge unless a scan completed on the head commit and no open alerts exist for secrets the PR introduced
  • Provider patterns are blocked by default; custom and generic pattern categories are opt-in
  • Requires GitHub Secret Protection or GitHub Advanced Security; configurable at repo, org, or enterprise level
  • Start with provider patterns, keep the bypass list short, and treat the gate as a backstop — not your secrets strategy

A leaked key is a rotation, a redeploy, and a log review — not a one-line fix. We set up deployment pipelines with secret management, scoped credentials, and gates that fail loudly before anything ships. See how we build systems you can deploy without holding your breath, or have us audit what is currently in your git history.

Sources: GitHub Changelog, GitHub Changelog: agentic autofix for Code Quality.

  • #github
  • #secret-scanning
  • #ci-cd
  • #devsecops
  • #dev-tools
TR

Tommy Rush — Founder, Rush Commerce

Operator turned builder. 15+ years running operations — now shipping the systems businesses run on. More

Get The Rush Report weekly — one email, zero fluff.