From 94921230d9e60a30868ac5a89940f53a6b782469 Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Mon, 26 Apr 2021 15:37:16 -0300 Subject: [PATCH] Avoid duplicate CI pipelines running at the same time Docs: https://docs.gitlab.com/ee/ci/yaml/README.html#switch-between-branch-pipelines-and-merge-request-pipelines https://docs.gitlab.com/ee/ci/yaml/README.html#avoid-duplicate-pipelines --- .gitlab-ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2163f5717..f5ca1b73c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,6 +5,15 @@ stages: - optional_tests - check_reproducibility +workflow: + # when to create a CI pipeline + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' + - if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS' + when: never # avoids duplicate jobs for branch and MR + - if: '$CI_COMMIT_BRANCH' + - if: '$CI_COMMIT_TAG' + .base-test: before_script: - set -e