repo
scope to use this endpoint. GitHub Apps must have the administration:write
permission for the repository to use this endpoint.curl --location --request PUT 'https://api.github.com/repos///environments/' \
--header 'Content-Type: application/json' \
--data-raw '{
"deployment_branch_policy": {
"custom_branch_policies": true,
"protected_branches": false
},
"reviewers": [
{
"id": 1,
"type": "User"
},
{
"id": 1,
"type": "Team"
}
],
"wait_timer": 30
}'
{
"created_at": "2020-11-23T22:00:40.000Z",
"deployment_branch_policy": {
"custom_branch_policies": true,
"protected_branches": true
},
"html_url": "https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging",
"id": 56780428,
"name": "staging",
"node_id": "MDExOkVudmlyb25tZW50NTY3ODA0Mjg=",
"protection_rules": [
{
"id": 3515,
"node_id": "MDQ6R2F0ZTM1MTU=",
"type": "wait_timer",
"wait_timer": 30
}
],
"updated_at": "2020-11-23T22:00:40.000Z",
"url": "https://api.github.com/repos/github/hello-world/environments/staging"
}
null
.custom_branch_policies
is true
, protected_branches
must be false
; if custom_branch_policies
is false
, protected_branches
must be true
.protected_branches
is true
, custom_branch_policies
must be false
; if protected_branches
is false
, custom_branch_policies
must be true
.null
.custom_branch_policies
is true
, protected_branches
must be false
; if custom_branch_policies
is false
, protected_branches
must be true
.protected_branches
is true
, custom_branch_policies
must be false
; if protected_branches
is false
, custom_branch_policies
must be true
.