Skip to content

Review custom deployment protection rules for a workflow run

POST
/repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule

Approve or reject custom deployment protection rules provided by a GitHub App for a workflow run. For more information, see “Using environments for deployment.”

[!NOTE] GitHub Apps can only review their own custom deployment protection rules. To approve or reject pending deployments that are waiting for review from a specific person or team, see POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository.

API method documentation

owner
required
string

The account owner of the repository. The name is not case sensitive.

repo
required
string

The name of the repository without the .git extension. The name is not case sensitive.

run_id
required
integer

The unique identifier of the workflow run.

Media type application/json
Any of:
object
environment_name
required

The name of the environment to approve or reject.

string
comment
required

Comment associated with the pending deployment protection rule. Required when state is not provided.

string
Examples
Example default
{
"environment_name": "prod-eus",
"state": "approved",
"comment": "All health checks passed."
}

Response