Skip to content
Snippets Groups Projects
Commit 0bdec1c6 authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

fix(workflow): disable MR pipeline from prod & integ branches

Today creating a backmerge MR from prod or integ branch to any other branch triggers a pipeline
even though no change has been pushed.
Ultimately those pipelines might (re)trigger integration or production environment deployment and/or packages publication.
That might have unexpected consequences.
This change simply disables MR pipeline from prod & integ branches, enforcing branch pipelines only (i.e. when a true commit is pushed).
parent 1e8c7630
No related branches found
Tags 3.11.3
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment