Deployment approvals
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
You can require additional approvals for deployments to protected environments. Deployments are blocked until all required approvals are given.
Use deployment approvals to accommodate testing, security, or compliance processes. For example, you might want to require approvals for deployments to production environments.
Configure deployment approvals
You can require approvals for deployments to protected environments in a project.
Prerequisites:
- To update an environment, you must have at least the Maintainer role.
To configure deployment approvals for a project:
Create a deployment job in the
.gitlab-ci.yml
file of your project:stages: - deploy production: stage: deploy script: - 'echo "Deploying to ${CI_ENVIRONMENT_NAME}"' environment: name: ${CI_JOB_NAME} action: start
The job does not need to be manual (
when: manual
).Add the required approval rules.
The environments in your project require approval before deployment.
Add multiple approval rules
Add multiple approval rules to control who can approve and execute deployment jobs.
To configure multiple approval rules, use the CI/CD settings. You can also use the API.
All jobs deploying to the environment are blocked and wait for approvals before running. Make sure the number of required approvals is less than the number of users allowed to deploy.
After a deployment job is approved, you must run the job manually.
Allow self-approval
By default, the user who triggers a deployment pipeline can’t also approve the deployment job.
A GitLab administrator can approve or reject all deployments.
To allow self-approval of a deployment job:
- On the left sidebar, select Search or go to and find your project.
- Select Settings > CI/CD.
- Expand Protected environments.
- From the Approval options, select the Allow pipeline triggerer to approve deployment checkbox.
Approve or reject a deployment
In an environment with multiple approval rules, you can:
- Approve a deployment to allow it to proceed.
- Reject a deployment to prevent it.
Prerequisites:
- You have permission to deploy to the protected environment.
To approve or reject a deployment:
- On the left sidebar, select Search or go to and find your project.
- Select Operate > Environments.
- Select the environment’s name.
- Find the deployment and select its Status badge.
- Optional. Add a comment which describes your reason for approving or rejecting the deployment.
- Select Approve or Reject.
You can also use the API.
The corresponding deployment job does not run automatically after a deployment is approved.
View the approval details of a deployment
Prerequisites:
- You have permission to deploy to the protected environment.
A deployment to a protected environment can proceed only after all required approvals have been granted.
To view the approval details of a deployment:
- On the left sidebar, select Search or go to and find your project.
- Select Operate > Environments.
- Select the environment’s name.
- Find the deployment and select its Status badge.
The approval status details are shown:
- Eligible approvers
- Number of approvals granted, and number of approvals required
- Users who have granted approval
- History of approvals or rejections
View blocked deployments
Review the status of your deployments, including whether a deployment is blocked.
To view your deployments:
- On the left sidebar, select Search or go to and find your project.
- Select Operate > Environments.
- Select the environment being deployed to.
A deployment with the blocked label is blocked.
To view your deployments, you can also use the API.
The status
field indicates whether a deployment is blocked.
Related topics
Docs
Edit this page to fix an error or add an improvement in a merge request.
Create an issue to suggest an improvement to this page.
Product
Create an issue if there's something you don't like about this feature.
Propose functionality by submitting a feature request.
Feature availability and product trials
View pricing to see all GitLab tiers and features, or to upgrade.
Try GitLab for free with access to all features for 30 days.
Get help
If you didn't find what you were looking for, search the docs.
If you want help with something specific and could use community support, post on the GitLab forum.
For problems setting up or using this feature (depending on your GitLab subscription).
Request support