GitHub introduces rulesets to block PRs with exposed secrets from merging
GitHub has launched a new capability within repository rulesets that blocks pull requests from merging if they introduce secret scanning alerts. This feature provides an additional layer of protection by ensuring all detected secrets are resolved before code can be merged into a repository, complementing existing push protection mechanisms. It is available in public preview for customers with GitHub Secret Protection or GitHub Advanced Security. Developers must resolve alerts to clear the block, impacting workflows where secrets might be unintentionally committed.
- →Block pull requests with exposed secrets from merging
- →Complements existing push protection
- →Configure the new rule for repositories
Features (1) ›
- Block pull requests with exposed secrets from merging
Repository rulesets can now be configured to prevent pull requests from merging if they introduce secret scanning alerts. This rule checks 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. By default, it runs on open PRs and blocks secrets found via provider patterns, with options to configure for custom or generic patterns.
Notes (2) ›
- Complements existing push protection
This new rule adds protection at the pull request layer, catching secrets that push protection might miss or not be configured to block. While push protection stops secrets at the push, this PR-level rule provides an additional safeguard, allowing for more granular control over different secret types, such as enabling it for generic patterns even if push protection is disabled for them.
- Configure the new rule for repositories
The 'Require secret scanning alerts are resolved' rule can be enabled in your repository, organization, or enterprise settings under the Repository > Rulesets tab. It can also be configured programmatically via the REST API using the `require_secret_scanning_alert_resolution` rule type with a `secret_types` parameter, or through GraphQL as `REQUIRE_SECRET_SCANNING_ALERT_RESOLUTION`.
https://github.blog/changelog/2026-09-09-block-pull-requests-with-exposed-secrets-from-merging
Related releases
- GitHub Advanced Security trial expands to more Enterprise Cloud customers GitHub Changelog ·
- GitHub Copilot Introduces Agentic Autofix for Code Quality Findings GitHub Changelog ·
- GitHub Copilot for JetBrains Adds Enterprise Sandbox Controls and CLI Integration GitHub Changelog ·
- GitHub Enterprise Server 3.22 Now Generally Available GitHub Changelog ·
- GitHub Introduces New Unified Customer Portal for Support and Resources GitHub Changelog ·
- GitHub unveils a redesigned customer portal at help.github.com GitHub Changelog ·