CI/CD pipelines automate building, testing, and deploying code. Before a production deployment, a human reviewer needs a chance to assess the changes and stop a release with known issues. A deployment gate pauses the pipeline until that review is complete.
GitHub adds manual approval steps to workflows through the environments feature.
Environments also support per-environment secrets, timers, and protection rules. Feature availability depends on repository visibility and plan:
Only repository administrators can configure environment reviewers, timers, and secrets.
Required reviewers on private repositories need GitHub Enterprise. Without that control, users with write access can trigger deployment workflows without a required reviewer's approval, subject to other deployment controls and plan limits. See which GitHub plan you need.
Figure: Add required reviewers
When a deployment job references an environment with required reviewers, GitHub pauses the job and notifies the reviewers. A reviewer can approve or reject the deployment and add comments. After approval, the job continues.
GitHub also shows the review information in the deployment summary.
Most projects use multiple environments such as dev, staging, and prod. You can add as many environments as needed to suit your team or project.
Here is a high-level workflow for building and deploying a project:
devstagingprodThe required reviewer uses approvals to control which changes reach staging, so new deployments do not disrupt testing.
Before approving a deployment to prod, the required reviewer checks for known issues that could affect users.
Here is an example of a workflow waiting for manual approval from a required reviewer before deploying to the prod environment:
Figure: Waiting for manual approval to deploy to Prod
The reviewer approves the deployment to let the job continue.
Figure: Manually approving a review before deploying to the next environment
See repo action run using gated deployment in GitHub
An agent can prepare a release while a human controls approval of the production deployment:
Verify the boundary in a disposable project with equivalent controls, using the agent's actual identity. Deployment must wait for human approval, and the approved path must deploy only the reviewed artifact. Recheck after permission changes.
A deployment gate does not protect separate actions such as package publishing or release-branch merges. When those are reserved for a human, restrict them separately.