ci: Restrict "success" job to pipelines for MRs
authorMichel Dänzer <mdaenzer@redhat.com>
Fri, 28 Aug 2020 15:08:57 +0000 (17:08 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 1 Sep 2020 08:01:26 +0000 (08:01 +0000)
Expected benefits:

* No more spurious non-MR pipelines with just this job.
* No more warnings from GitLab such as on
  https://gitlab.freedesktop.org/mesa/mesa/-/pipelines/195778

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

.gitlab-ci.yml

index 35593d7909f6881874a8c678f4e4cec4e43d6a2a..3fea645d4140eaa5735e71362401773805f9da74 100644 (file)
@@ -126,7 +126,8 @@ success:
       when: never
     - changes: *all_paths
       when: never
-    - when: on_success
+    - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == $CI_COMMIT_REF_NAME'
+      when: on_success
   variables:
     GIT_STRATEGY: none
   script: