Update required status checks of protected branch

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.

PATCH /repos/:owner/:repo/branches/:branch/protection/required_status_checks

Parameters

The object passed can have the following keys:

Name Type Description
strict boolean Require branches to be up to date before merging.
contexts array The list of status checks to require in order to merge into this branch

Example

{
  "strict": true,
  "contexts": [
    "continuous-integration/travis-ci"
  ]
}

Response

Status: 200 OK
{
  "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"
}