From f5ed10d8574fcf16f268e5671982d92b8cbdf9b7 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Wed, 9 Oct 2024 14:00:29 -0400 Subject: [PATCH] ci: Add workflow rules to avoid duplicate branch/MR pipelines Copied from pipewire@15b5185e6fa5d4437b6acd9cbdf7a698e01019ab --- .gitlab-ci.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 30a47787..8ceb9e81 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,3 +1,13 @@ +# Create merge request pipelines for open merge requests, branch pipelines +# otherwise. This allows MRs for new users to run CI, and prevents duplicate +# pipelines for branches with open MRs. +workflow: + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS + when: never + - if: $CI_COMMIT_BRANCH + stages: - container - container_coverity