octokit.rest

Update status check protection

Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.

Updating required status checks requires admin or owner permissions to the repository and branch protection to be enabled.

Parameters

string The token will be passed in the authorization header.

string

string

string branch+ parameter

boolean Require branches to be up to date before merging.

string[] The list of status checks to require in order to merge into this branch

Request

PATCH https://api.github.com/repos///branches//protection/required_status_checks
authorization: bearer undefined
accept: application/vnd.github.v3+json
user-agent: octokit.rest
content-length: 0


Example Response

Status: 200
{
  "url": "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks",
  "strict": true,
  "contexts": [
    "continuous-integration/travis-ci"
  ],
  "contexts_url": "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks/contexts"
}

See documentation on GitHub developer guides