Push rules in rulesets now support path exceptions
Push rules in rulesets now allow you to configure path exceptions, enabling rules to apply everywhere in scope except for specific file paths you choose to exempt.
You can now configure push rules more granularly by exempting specific file paths, so a rule applies everywhere in scope except the paths you choose. Path exceptions are in public preview.
Push rules give you strong control over what enters a repository. Sometimes a rule needs a narrow exception, and until now your options were to relax it for everyone or enforce it outside of GitHub. You can now keep the rule in place and exempt only the paths that need it.
Where to find it
When you configure either supported rule, expand Allowed exceptions and add the path patterns the rule should skip. GitHub validates your patterns when you save the ruleset, so you can fix mistakes right away.
Two push rules support exceptions today:
- Restrict file paths: Block a file type across the repository while allowing it at a specific path, such as blocking JAR files everywhere except
**/gradle/wrapper/*.jar. - Restrict file size: Enforce a size limit while exempting paths that already exceed it, so you can adopt the limit without changing those files first.
For pattern syntax and the full list of push rules, see available rules for rulesets.
Join the community discussion to share feedback.
The post Push rules in rulesets now support path exceptions appeared first on The GitHub Blog.
Source: original entry ↗
More from GitHub
Follow GitHub to get its new changes in your feed and email digest.
GitHub App improvements for least privilege and management
GitHub has released improvements to GitHub Apps that enable developers to migrate away from classic personal access tokens, enhance app management capabilities, and request fewer sensitive permissions for better security.
Gemini 4 Argon now available in GitHub Copilot
Google's Gemini 4 Argon frontier model is now generally available in GitHub Copilot, designed for complex coding, agentic, and reasoning tasks to enhance developer productivity.
Audit GitHub Code Quality finding dismissals and reopenings
Users can now review manual dismissals and reopenings of GitHub Code Quality findings in their organization or enterprise audit log, enabling better tracking and governance of code quality decisions.