DocsHow toAdd approval rules

How to add approval rules to a project

This guide shows you how to add approval rules to a project

  1. Create a new branch with a name like add-approvalrules-to-project
  2. Edit the .yaml file of the project in which you want to add the approval rules
  3. Add the approval rules you want to add to spec.approvalRules. For example
approvalRules:
    - name: Approval rule
      appliesToAllProtectedBranches: true
      approvalsRequired: 2
      groupIds: []
      protectedBranchIds: []
      ruleType: regular
      usernames:
        - test.user

ℹ️ For more information about the approval rule resource, please take a look at the GitlabApprovalRule resource


  1. Create a merge request
  2. Wait for the dry run to finish and check if the changelist contains the expected changes

  1. After making sure the changes are correct, have someone check and approve your merge request and start the deployment by clicking on the play button of the deploy job

  1. When the deploy job has finished successfully, the merge request will automatically be merged.