Skip to content

Conversation

@psyhomb
Copy link
Contributor

@psyhomb psyhomb commented May 5, 2020

It's going to fix the error that will encounter if Require pull request reviews before merging is already enabled:

2020/05/05 09:27:58 PUT https://api.github.com/repos/:owner/:repo/branches/:branch/protection: 422 Invalid request.
No subschema in "anyOf" matched.
0 must be greater than or equal to 1.
Not all subschemas of "allOf" matched.
For 'anyOf/1', {"dismissal_restrictions"=>{"users"=>[], "teams"=>[]}, "dismiss_stale_reviews"=>false, "require_code_owner_reviews"=>false, "required_approving_review_count"=>0} is not a null. []

because required_approving_review_count must be greater than 0 if this rule is enabled and with current code we are always forcing a zero value which in case of int type is 0, by making this change we're going to get the current value and just pass it as parameter.
Flameshot-2020-05-06_01-58-30

…fore merging' is already enabled.

2020/05/05 09:27:58 PUT https://api.github.com/repos/:owner/:repo/branches/:branch/protection: 422 Invalid request.
No subschema in "anyOf" matched.
0 must be greater than or equal to 1.
Not all subschemas of "allOf" matched.
For 'anyOf/1', {"dismissal_restrictions"=>{"users"=>[], "teams"=>[]}, "dismiss_stale_reviews"=>false, "require_code_owner_reviews"=>false, "required_approving_review_count"=>0} is not a null. []
Copy link
Member

@aknysh aknysh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @psyhomb

@aknysh aknysh merged commit 6aa6fef into cloudposse:master May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants