gitlab-ci: Use single if for manual job rules entry
authorMichel Dänzer <mdaenzer@redhat.com>
Mon, 20 Jan 2020 17:39:50 +0000 (18:39 +0100)
committerMarge Bot <eric+marge@anholt.net>
Wed, 22 Jan 2020 16:42:11 +0000 (16:42 +0000)
I thought multiple ifs would all need to match, but looks like only the
last one (or either one?) does.

This should prevent a manual pipeline from getting created after merging
changes which can't affect the pipeline.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3474>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3474>

.gitlab-ci.yml

index 46cacb60e39bb496217c0bc84ed6039bd00d5282..90bb3b33feffca59bd8f2323dcea430f2e98d003 100644 (file)
@@ -45,8 +45,7 @@ stages:
         *paths
       when: on_success
     # Allow triggering jobs manually on branches of forked projects
-    - if: '$CI_PROJECT_PATH != "mesa/mesa"'
-      if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != $CI_COMMIT_REF_NAME'
+    - if: '$CI_PROJECT_PATH != "mesa/mesa" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != $CI_COMMIT_REF_NAME'
       when: manual
     # Otherwise, most jobs won't run
     - when: never