From dfa328a7696f876807f58ff951d16a165786b96f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 1 Feb 2024 16:18:03 +0100 Subject: [PATCH] ci: Do not create pipelines for branches with open MRs Pipelines for non-protected branches are set to 'manual', and thus cheap. However they may still get picked by `@marge-bot`, meaning that the bot waits for the completion of a pipeline that never starts. Avoid that by not creating pipelines for branches with open merge requests. Credit to Jordan, who came up with this for gst. Part-of: --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4f90a1fc..a49cb093 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,6 +32,8 @@ variables: workflow: rules: + - if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"' + when: never - if: '$CI_MERGE_REQUEST_IID' - if: '$CI_COMMIT_TAG' - if: '$CI_COMMIT_BRANCH'