How to Run a Manual Approval Gate in GitHub Actions
Some deploys should wait for a human; a protected environment pauses the job until a named reviewer clicks approve.
Create an environment with required reviewers, then attach the gated job to it via environment:. The run pauses until approved.
Steps
- Create an environment (e.g.
production) in repo settings. - Add required reviewers and an optional wait timer.
- Attach the gated job with
environment: production. - The run pauses at that job until a reviewer approves.
Workflow
.github/workflows/deploy.yml
jobs:
build:
runs-on: ubuntu-latest
steps:
- run: ./build.sh
deploy:
needs: build
runs-on: ubuntu-latest
environment: production
steps:
- run: ./deploy.shGotchas
- Required reviewers are an environment setting, not workflow YAML; configure them in repo settings.
- A pending approval holds a runner slot only briefly; the job waits without consuming compute.
- Latchkey runs the approved job on cheaper runners that retry transient failures after the gate clears.
Related guides
How to Restrict Who Can Trigger workflow_dispatch in GitHub ActionsLimit who can manually run a GitHub Actions workflow_dispatch by checking the actor permission level with the…
How to Gate Deploy on a Successful Staging Deploy in GitHub ActionsBlock a production deploy in GitHub Actions until staging deploys successfully, using job dependencies and a…