diff --git a/templates/gitlab-ci-semrel.yml b/templates/gitlab-ci-semrel.yml index 068ba5862b57660c97ec0dd43f1a8e04e388b6fd..3e25452b04f21fd2eef859fd1dbf4129ae7dd986 100644 --- a/templates/gitlab-ci-semrel.yml +++ b/templates/gitlab-ci-semrel.yml @@ -73,8 +73,11 @@ spec: --- 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