diff options
author | Simon Ser <contact@emersion.fr> | 2024-04-22 17:59:34 +0200 |
---|---|---|
committer | Daniel Stone <daniels@collabora.com> | 2024-05-09 09:02:52 +0000 |
commit | f573fa11cf97f425ddb021e16baf910b8403e76a (patch) | |
tree | 99ceb0b48a10b778ca3a0f06b66252b14c65a2ea | |
parent | c5b47dc928107bcb6966f0f7a47813bfc0a59bfb (diff) |
Currently our CI setup has a downside: for each push on a merge
request, two pipelines are triggered. The first is triggered in
the context of the forked repository, and the second is triggered
in the context of the MR in the parent repository.
Replace the workflow rules with the ones in the official docs [1],
so that a branch pipeline isn't triggered when a MR exists for that
branch.
[1]: https://docs.gitlab.com/ee/ci/yaml/workflow.html#switch-between-branch-pipelines-and-merge-request-pipelines
Signed-off-by: Simon Ser <contact@emersion.fr>
Fixes: fbf7fc351715 ("ci: use detached CI pipelines")
-rw-r--r-- | .gitlab-ci.yml | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5f47939..dbb6f23 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,8 +18,10 @@ variables: workflow: rules: - - if: $CI_PIPELINE_SOURCE == 'merge_request_event' - - if: $CI_PIPELINE_SOURCE == 'push' + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS + when: never + - if: $CI_COMMIT_BRANCH .debian: variables: |