Edit a branch protections for a repository. Only fields that are set will be changed
PATCH
/repos/{owner}/{repo}/branch_protections/{name}
repository
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request PATCH '/api/v1/repos///branch_protections/' \
--header 'Content-Type: application/json' \
--data-raw '{
"approvals_whitelist_teams": [
"string"
],
"approvals_whitelist_username": [
"string"
],
"block_on_official_review_requests": true,
"block_on_outdated_branch": true,
"block_on_rejected_reviews": true,
"dismiss_stale_approvals": true,
"enable_approvals_whitelist": true,
"enable_merge_whitelist": true,
"enable_push": true,
"enable_push_whitelist": true,
"enable_status_check": true,
"merge_whitelist_teams": [
"string"
],
"merge_whitelist_usernames": [
"string"
],
"protected_file_patterns": "string",
"push_whitelist_deploy_keys": true,
"push_whitelist_teams": [
"string"
],
"push_whitelist_usernames": [
"string"
],
"require_signed_commits": true,
"required_approvals": 0,
"status_check_contexts": [
"string"
]
}'
Response Response Example
200 - Example 1
{
"approvals_whitelist_teams": [
"string"
],
"approvals_whitelist_username": [
"string"
],
"block_on_official_review_requests": true,
"block_on_outdated_branch": true,
"block_on_rejected_reviews": true,
"branch_name": "string",
"created_at": "2019-08-24T14:15:22Z",
"dismiss_stale_approvals": true,
"enable_approvals_whitelist": true,
"enable_merge_whitelist": true,
"enable_push": true,
"enable_push_whitelist": true,
"enable_status_check": true,
"merge_whitelist_teams": [
"string"
],
"merge_whitelist_usernames": [
"string"
],
"protected_file_patterns": "string",
"push_whitelist_deploy_keys": true,
"push_whitelist_teams": [
"string"
],
"push_whitelist_usernames": [
"string"
],
"require_signed_commits": true,
"required_approvals": 0,
"status_check_contexts": [
"string"
],
"updated_at": "2019-08-24T14:15:22Z"
}
Request
Path Params
owner
stringÂ
required
repo
stringÂ
required
name
stringÂ
required
Body Params application/json
Responses
Modified at 2022-09-10 23:12:52