Cant run code_quality job only on specific branch
Summary
I recently enable code_quality jobs for one of my client wit gitlab-ee 13.0.3 but unfortunately, I can't specify on which branch/tag to run this jobs.
Steps to reproduce
In my current workflow, I do nothing (no CI jobs) on release branches (releasing and packaging are done during tag). I try to override existing rules, to only start jobs on feature and develop branch. Unfortunately i still have the code_quality job at each push on release.
Example Project
Hosted gitlab, so no example sorry. But here is a representative example :
include:
- template: Code-Quality.gitlab-ci.yml
code_quality:
rules:
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
when: never
- if: '$CI_COMMIT_REF_NAME =~ /^feature/ || $CI_COMMIT_REF_NAME = develop || $CI_COMMIT_TAG'
when: always
What is the current bug behavior?
Code quality jobs run on every branches/tags push
What is the expected correct behavior?
Code quality job run only on feature, develop and tag push.
Results of GitLab environment info
Hosted gitlab version 13.0.5-ee setup with helm chart version 4.0.4
Edited by Ivan Beauté