changeset 50737:429880fd984c stable

heptapod-ci: don't run pipelines for topic-less branches See inline comment for more details.
author Raphaël Gomès <rgomes@octobus.net>
date Mon, 03 Jul 2023 11:02:36 +0200
parents b852c34dc2b8
children 2eaa883778f7
files contrib/heptapod-ci.yml
diffstat 1 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/heptapod-ci.yml	Tue Jun 27 16:19:42 2023 +0200
+++ b/contrib/heptapod-ci.yml	Mon Jul 03 11:02:36 2023 +0200
@@ -1,3 +1,20 @@
+# Don't run pipelines on branch "merge", since we're fast-forward only.
+# Gitlab sees a new branch (since e.g. `topic/stable/my-topic` becomes
+# `branch/stable`), but the hash hasn't changed. There is no reason to
+# re-run the CI in our case, since we haven't built up any specific automation.
+# Right now it's just wasted CI and developer time.
+# One can still run the pipeline manually via the web interface or a push,
+# like in the case of releases, to make *extra* sure that the actual branch
+# has succeeded.
+workflow:
+  rules:
+    - if: $CI_COMMIT_BRANCH =~ /^branch\// && $CI_PIPELINE_SOURCE != "web" && $CI_PIPELINE_SOURCE != "push"
+      when: never
+    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
+    - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
+      when: never
+    - if: $CI_COMMIT_BRANCH
+
 stages:
   - tests