Module: Mesa
Branch: main
Commit: 163c6fe4c4a9b15f93c553a1eacd61ec17fafc4f
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=163c6fe4c4a9b15f93c553a1eacd61ec17fafc4f

Author: Eric Engestrom <e...@igalia.com>
Date:   Mon Oct 30 17:45:40 2023 +0000

ci: add `.never-post-merge-rules` to avoid re-running pre-merge jobs after 
merging

This is entirely unnecessary and a 2x waste of resources.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25960>

---

 .gitlab-ci.yml | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 99163b3e155..630d88bcd1a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -140,6 +140,8 @@ include:
 .rules-anchors:
   # Post-merge pipeline
   - &is-post-merge '$CI_PROJECT_NAMESPACE == "mesa" && $CI_COMMIT_BRANCH'
+  # Post-merge pipeline after Marge has merged an MR
+  - &is-post-merge-for-marge '$CI_PROJECT_NAMESPACE == "mesa" && 
$CI_COMMIT_BRANCH && $GITLAB_USER_LOGIN != "marge-bot"'
   # Post-merge pipeline, not for Marge Bot
   - &is-post-merge-not-for-marge '$CI_PROJECT_NAMESPACE == "mesa" && 
$GITLAB_USER_LOGIN != "marge-bot" && $CI_COMMIT_BRANCH'
   # Pre-merge pipeline
@@ -150,6 +152,12 @@ include:
   - &is-pre-merge-not-for-marge '$GITLAB_USER_LOGIN != "marge-bot" && 
$CI_PIPELINE_SOURCE == "merge_request_event"'
 
 
+.never-post-merge-rules:
+  rules:
+    - if: *is-post-merge-for-marge
+      when: never
+
+
 .container+build-rules:
   rules:
     # Run when re-enabling a disabled farm, but not when disabling it

Reply via email to