PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews
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
andteams
replaces their previous values.
Servers
- https://api.github.com
Path parameters
Name | Type | Required | Description |
---|---|---|---|
repo |
String | Yes |
The name of the repository without the |
branch |
String | Yes |
The name of the branch. Cannot contain wildcard characters. To use wildcard characters in branch names, use the GraphQL API. |
owner |
String | Yes |
The account owner of the repository. The name is not case sensitive. |
Request headers
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
Request body fields
Name | Type | Required | Description |
---|---|---|---|
dismiss_stale_reviews |
Boolean | No |
Set to |
dismissal_restrictions |
Object | No |
Specify which users, teams, and apps can dismiss pull request reviews. Pass an empty |
dismissal_restrictions.teams[] |
Array | No |
The list of team |
dismissal_restrictions.apps[] |
Array | No |
The list of app |
dismissal_restrictions.users[] |
Array | No |
The list of user |
bypass_pull_request_allowances |
Object | No |
Allow specific users, teams, or apps to bypass pull request requirements. |
bypass_pull_request_allowances.teams[] |
Array | No |
The list of team |
bypass_pull_request_allowances.apps[] |
Array | No |
The list of app |
bypass_pull_request_allowances.users[] |
Array | No |
The list of user |
required_approving_review_count |
Integer | No |
Specifies the number of reviewers required to approve pull requests. Use a number between 1 and 6 or 0 to not require reviewers. |
require_last_push_approval |
Boolean | No |
Whether the most recent push must be approved by someone other than the person who pushed it. Default: Default value: false |
require_code_owner_reviews |
Boolean | No |
Blocks merging pull requests until code owners have reviewed. |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.