gitlab-ci: Fix "triggered by Marge for a merge request" rule
authorMichel Dänzer <mdaenzer@redhat.com>
Tue, 14 Jul 2020 09:12:19 +0000 (11:12 +0200)
committerMarge Bot <eric+marge@anholt.net>
Wed, 15 Jul 2020 08:54:15 +0000 (08:54 +0000)
The commit below changed the rule such that it accidentally also applied
to the non-MR pipelines created by Marge, resulting in Marge triggering
twice as many jobs as necessary.

Fixes: 549b4a3dd4ab "gitlab-ci: Automatically run pipelines for Marge
                     Bot pre-merge only"

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5898>

.gitlab-ci.yml

index 82a2abf939afa21a76e7bde13d01ea3b516c8298..e769069370d20e1621b32665a6a6d952d7bb1565 100644 (file)
@@ -173,7 +173,7 @@ success:
       when: on_success
     # Run pipeline by default if it was triggered by Marge Bot, is for a
     # merge request, and any files affecting the pipeline were changed
-    - if: '$GITLAB_USER_LOGIN == "marge-bot" && $CI_PROJECT_PATH != "mesa/mesa"'
+    - if: '$GITLAB_USER_LOGIN == "marge-bot" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == $CI_COMMIT_REF_NAME'
       changes:
         *all_paths
       when: on_success