Deployment approvals
DETAILS: Tier: Premium, Ultimate Offering: GitLab.com, 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
- Generally available in GitLab 15.0. Feature flag
deployment_approval_rules
removed.- UI configuration introduced in GitLab 15.11.
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
- Introduced in GitLab 15.8.
- Automatic approval removed in GitLab 16.2 due to usability issues.
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.