Skip to content

Branch Protection Rules API docs missing enforcement_level in required_status_checks #16691

@mhaley-tignis

Description

@mhaley-tignis

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/rest/reference/branches#update-branch-protection

What part(s) of the article would you like to see updated?

The parameters are not very clear on what to put inside required_status_checks, required_pull_request_reviews and restrictions. From the code sample, you can piece together most of it, but that example doesn't actually work. In my specific case I discovered that a required_status_checks object needs to look like below, at the minimum to enable status checks:

{
    "strict": true,
    "contexts": [],
    "enforcement_level": "non_admins"
}

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    contentThis issue or pull request belongs to the Docs Content teamrestContent related to rest - overview.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions