The name of the branch.
Get pull request review 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
Response
200 application/json
Response
Response
Protected Branch Pull Request Review
Protected Branch Pull Request Review
Example:https://api.github.com/repos/octocat/Hello-World/branches/master/protection/dismissal_restrictions
Show Child Parameters
Example:true
Example:true
>= 1<= 6
Example:2
Path Parameters
Update pull request review 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 pull request review enforcement requires admin or owner permissions to the repository and branch protection to be enabled.
Note: Passing new arrays of users
and teams
replaces their previous values.
Path Parameters
The name of the branch.
Body
application/json
Body
Specify which users and teams can dismiss pull request reviews. Pass an empty dismissal_restrictions
object to disable. User and team dismissal_restrictions
are only available for organization-owned repositories. Omit this parameter for personal repositories.
Show Child Parameters
Set to true
if you want to automatically dismiss approving reviews when someone pushes a new commit.
Blocks merging pull requests until code owners have reviewed.
Specifies the number of reviewers required to approve pull requests. Use a number between 1 and 6.
Response
application/json
Response
Response
Protected Branch Pull Request Review
Protected Branch Pull Request Review
Example:https://api.github.com/repos/octocat/Hello-World/branches/master/protection/dismissal_restrictions
Show Child Parameters
Example:true
Example:true
>= 1<= 6
Example:2
Path Parameters
Body
Delete pull request review 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
Response
Response
Path Parameters
Get 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 check whether a branch requires signed commits. An enabled status of true
indicates you must sign commits on this branch. For more information, see Signing commits with GPG in GitHub Help.
Note: You must enable branch protection to require signed commits.
Path Parameters
The name of the branch.
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
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
The name of the branch.
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