Skip to content

ghctl create protection displays schema error #57

Description

@jayvdb

I am trying to create a branch protection for master branch which uses all of the defaults. I can do this in the repo settings UI, e.g. only ticking "Include administrators", and leaving everything else unticked. This is useful because it leaves unticked "Allow force pushes" and "Allow deletions".

ghctl create protection -r xyz -b master --includeadmins
PUT https://api.github.com/repos/org/xyz/branches/master/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', {"dismiss_stale_reviews"=>false, "require_code_owner_reviews"=>false, "required_approving_review_count"=>0} is not a null. []

Adding --minapprove 0 doesnt help.

Adding --minapprove 1 does get past the error, but that also enables "Require status checks to pass before merging" without any status checks being selected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions