Approve or reject a GitHub Actions deployment via the custom deployment protection rule review API

domain: docs.github.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Register a GitHub App with Actions read-only and Deployments read-and-write repository permissions, subscribed to the 'Deployment protection rule' event, and install it on the target repository.
  2. Enable the app as a custom protection rule on the environment (Settings > Environments), or programmatically via POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules with the app's integration_id.
  3. When a workflow run reaches a job referencing that environment, GitHub sends a POST webhook with a deployment_protection_rule payload; validate it, then exchange the payload's installation ID for an installation access token scoped to deployments:write.
  4. To approve or reject, send POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule with a JSON body containing environment_name and state set to approved or rejected.
  5. Optionally post an interim status update by omitting state from the body (up to 10 times per deployment), or check approval status with GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals.

Known gotchas

Related routes

Configure GitHub branch protection rules and repository rulesets via API
docs.github.com · 5 steps · unrated
Configure a GitHub Actions matrix build that generates its matrix dynamically from a JSON file in the repository and fans out to per-environment deploy jobs using environment protection rules
GitHub Actions · 6 steps · unrated
Author a custom secret scanning regex pattern at the GitHub organization level, validate it with a dry run, then publish and enable it for push protection
docs.github.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans