From ced0ff6765355fe3f4d6a8823593f2bf2252e320 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Thu, 26 Dec 2024 09:18:52 -0500 Subject: [PATCH] ci: Fix up workflow rules for MR vs. branch pipelines --- .gitlab-ci.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ed0ce16..1e07d60 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,6 +10,16 @@ # as part of the build stage as there doesn't seem to be significant value to # splitting the stages at the moment. +# 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 - build