-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Description
Since we updated our code to use the latest version of this library, we can't create a branch protection that requires branches to be up to date before merging but don't require any status checks:
func (r *RepoSettings) protectionRequestOptions() *github.ProtectionRequest {
return &github.ProtectionRequest{
EnforceAdmins: r.EnforceAdmins,
RequiredPullRequestReviews: &github.PullRequestReviewsEnforcementRequest{
DismissStaleReviews: r.DismissStaleReviews,
RequiredApprovingReviewCount: r.RequiredApprovingReviewCount,
RequireCodeOwnerReviews: r.RequireCodeOwnerReviews,
},
RequiredStatusChecks: &github.RequiredStatusChecks{
Strict: true,
},
}
}
The above results in an error:
PUT https://api.github.com/repos/****/****/branches/main/protection: 422 Invalid request.
No subschema in "anyOf" matched.
No subschema in "oneOf" matched.
Not all subschemas of "allOf" matched.
For 'anyOf/1', {"strict"=>true} is not a null. []
Such rule is possible to be created from the UI:
This is also affecting the Github Terraform provider: integrations/terraform-provider-github#1147
gmlewis, knadsady and joelfernandes23
Metadata
Metadata
Assignees
Labels
No labels