The name of the branch.
Create commit signature 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.
When authenticated with admin or owner permissions to the repository, you can use this endpoint to require signed commits on a branch. You must enable branch protection to require signed commits.
Path Parameters
Response
application/json
Response
Response
Protected Branch Admin Enforced
Protected Branch Admin Enforced
Example:https://api.github.com/repos/octocat/Hello-World/branches/master/protection/enforce_admins
Example:true
Path Parameters
Delete commit signature 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.
When authenticated with admin or owner permissions to the repository, you can use this endpoint to disable required signed commits on a branch. You must enable branch protection to require signed commits.
Path Parameters
The name of the branch.
Response
Response
Response
Path Parameters
Get status checks 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.
Path Parameters
The name of the branch.
Response
application/json
Response
Response
Status Check Policy
Status Check Policy
Example:https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks
Example:true
Example:["continuous-integration/travis-ci"]
Example:https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks/contexts
Path Parameters
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.
Path Parameters
The name of the branch.
Body
application/json
Body
Require branches to be up to date before merging.
The list of status checks to require in order to merge into this branch
Response
application/json
Response
Response
Status Check Policy
Status Check Policy
Example:https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks
Example:true
Example:["continuous-integration/travis-ci"]
Example:https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks/contexts
Path Parameters
Body
Remove 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.
Path Parameters
The name of the branch.
Response
204
Response
Response