diff --git a/templates/gitlab-ci-bash.yml b/templates/gitlab-ci-bash.yml index 4c36e47592b905c0a67fa45aeb1681e447e11f84..971a5cad4f77554009ee990a049e0448a207c94c 100644 --- a/templates/gitlab-ci-bash.yml +++ b/templates/gitlab-ci-bash.yml @@ -53,8 +53,11 @@ spec: # default workflow rules: Merge Request pipelines workflow: rules: - # prevent branch pipeline when an MR is open (prefer MR pipeline) - - if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS' + # prevent MR pipeline originating from production or integration branch(es) + - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ $PROD_REF || $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ $INTEG_REF' + when: never + # on non-prod, non-integration branches: prefer MR pipeline over branch pipeline + - if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_COMMIT_REF_NAME !~ $PROD_REF && $CI_COMMIT_REF_NAME !~ $INTEG_REF' when: never - if: '$CI_COMMIT_MESSAGE =~ "/\[(ci skip|skip ci) on ([^],]*,)*tag(,[^],]*)*\]/" && $CI_COMMIT_TAG' when: never