Currently gitlab spawns 2 pipelines, one for the branch and
another for the merge request.
Update our rules so that only one of them is spawned depending
on the situation.
https://docs.gitlab.com/ee/ci/yaml/index.html#switch-between-branch-pipelines-and-merge-request-pipelines
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/958>
-Dgstreamer-sharp:werror=true
workflow:
+ # https://docs.gitlab.com/ee/ci/yaml/index.html#switch-between-branch-pipelines-and-merge-request-pipelines
rules:
- - if: $CI_MERGE_REQUEST_IID
- - if: $CI_COMMIT_TAG
- - if: $CI_COMMIT_BRANCH
+ - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
+ - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"
+ when: never
+ - if: '$CI_COMMIT_BRANCH'
#
# Global CI policy