Manage the code coverage ruleset condition with the REST API
By Steven Van ·
The code coverage ruleset can now be created, updated and read via the REST API on GitHub Team and Enterprise Cloud.
The Restrict code coverage ruleset option can now be managed through the REST API, not just the web interface. This ruleset lets a repository enforce a minimum line coverage percentage or cap how much coverage a pull request is allowed to drop, and the API support means it can now be created, updated, and read programmatically, useful for applying the same coverage rules across many repositories or from infrastructure-as-code workflows.
Using the rule still requires GitHub Code Quality to be enabled on the repository with code coverage uploads configured. It's available on GitHub Enterprise Cloud and GitHub Team, including Enterprise Cloud with data residency, but not on GitHub Enterprise Server. See the available rules for rulesets documentation for details, via GitHub's changelog post.
