GitHub Adds REST API Control for Code Coverage Rules
GitHub has expanded programmatic control over repository rules by making the Restrict code coverage option available through its generally available REST API. The change adds API support to an option that was previously configurable only through GitHub’s web interface.

API management comes to code coverage rules
GitHub says developers can now manage the Restrict code coverage repository ruleset option through its generally available REST API. The option was already supported in GitHub’s web interface, but API access allows teams to handle the same configuration through software and automation.
The API support covers the core lifecycle of the ruleset option. Organizations can create, update, and read the setting programmatically, giving them a way to manage code coverage requirements without relying exclusively on manual changes in repository settings.
What the ruleset can enforce
The code coverage ruleset is designed to enforce a minimum code coverage percentage. GitHub’s description specifies that the threshold can be based on line coverage, allowing a repository to require a defined level of coverage before changes satisfy its configured policy.
The option can also set a maximum tolerable coverage drop for a pull request. This gives teams another way to express a coverage requirement: instead of only requiring a minimum overall percentage, a repository can limit how much coverage is allowed to decline when a pull request is evaluated.
Automation for consistent repository policies
GitHub says the new capability can make it easier to manage code coverage requirements consistently across many repositories. Rather than configuring the rule separately through each repository’s web settings, teams can use the REST API to apply and inspect the option through their existing management processes.
The company also positions the change as useful for infrastructure-as-code workflows. API-based configuration can place code coverage rules alongside other repository settings that are managed through automation, although the source does not specify particular tools, configuration formats, or implementation patterns.
Required coverage setup
The ruleset has prerequisites. To use it, a repository must have GitHub Code Quality enabled, and code coverage uploads must be configured. These requirements connect the policy to GitHub’s code-quality and coverage data capabilities rather than making the ruleset an independent coverage measurement system.
The source does not identify a different setup process for API users compared with users of the web interface. It does make clear that repositories need both the Code Quality feature and coverage uploads in place before the code coverage rule can be used.
Availability across GitHub plans
The REST API capability is available on GitHub Enterprise Cloud and GitHub Team. GitHub also includes GitHub Enterprise Cloud with data residency in the supported availability list.
GitHub Enterprise Server is not supported for this feature, according to the company’s announcement. The availability statement applies to the Restrict code coverage ruleset option and its API management support described in the release.
A broader ruleset management workflow
By adding REST API support, GitHub turns the code coverage condition into a setting that can be handled alongside other automated repository controls. The immediate change is specific: teams can now read and modify this ruleset option through an API instead of depending only on the web interface.
For teams managing multiple repositories, the change provides a more centralized way to keep coverage policies aligned. Its practical use still depends on the required Code Quality configuration and coverage uploads, as well as the repository’s GitHub plan.
Sources
- GitHub ChangelogManage the code coverage ruleset condition with the REST API