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

Review custom deployment protection rules for a workflow run

Submits an approval or rejection for a custom deployment protection rule on a workflow run. Use this endpoint when your GitHub App owns the rule; to review a deployment waiting on a person or team, use POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments instead. OAuth app tokens and personal access tokens (classic) need the repo scope for private repositories.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

3 parameters · 2 body fields
ownerstringrequired
The account owner of the repository. The name is not case sensitive.
repostringrequired
The repository name without the `.git` extension. The name is not case sensitive.
run_idintegerrequired
The unique identifier of the workflow run.

Review details for a custom deployment protection rule. Provide environment_name and either comment without state, or state with an optional comment.

environment_namestringrequired
The name of the environment to approve or reject.
commentstringrequired
Comment associated with the pending deployment protection rule. **Required when state is not provided.**

1 status code
204Returns no content after the custom deployment protection rule review is submitted.

Error handling

environment_name is required, and the body must include either comment or state. If you provide state, it must be approved or rejected; if you omit state, comment is required.