DocsHow toAdd push rules

How to add push rules to a project

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

  1. Create a new branch with a name like add-pushrules-to-project
  2. Edit the .yaml file of the project in which you want to add the pushrule
  3. Add the push rules you want to add to spec.pushRules. For example
pushRules:
    branchNameRegex: ^((feature|hotfix|bugfix)\/[A-Z]{2,8}-\d{1,4}.{1,}|renovate\/.{1,}|development|master|release\/.{1,})
    commitCommitterCheck: true
    rejectUnsignedCommits: true

ℹ️ For more information about the push rule resource, please take a look at the GitLabPushRule 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.