Open
Description
There does not appear to a rule for enforcing status checks in branch protections, e.g.
Examining the Github API output for the branch protections shown in the screenshot, the relevant part of the response is:
"required_status_checks": {
"url": "https://api.github.com/repos/dmjb-test-org/action-test/branches/main/protection/required_status_checks",
"strict": true,
"contexts": [
"A job to say hello"
],
"contexts_url": "https://api.github.com/repos/dmjb-test-org/action-test/branches/main/protection/required_status_checks/contexts",
"checks": [
{
"context": "A job to say hello",
"app_id": 15368
}
]
}
Notes:
- If the
Require status checks to pass before merging
is unselected, thenrequired_status_checks
is set to null. - The
Require branches to be up to date before merging
checkbox corresponds to thestrict
flag in the JSON object. - It is possible to select these options without setting up a list of checks. Personal experience shows that this results in the checks not working (or at least not working consistently). We probably want to enforce that the
Require status checks to pass before merging
box is selected and the list of checks to be non-empty. - We may want to create a separate rule for
Require branches to be up to date before merging
or at least make it optional when creating a policy.