Skip to content

0.3.0 Fix: 422 Invalid request

Compare
Choose a tag to compare
@aknysh aknysh released this 07 May 00:24
6aa6fef

what

  • Fix: 422 Invalid request

why

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