gitlab CI: don't run MR pipelines in forks
authorPeter Hutterer <peter.hutterer@who-t.net>
Mon, 29 Apr 2024 22:43:55 +0000 (08:43 +1000)
committerduna.oh <duna.oh@samsung.com>
Thu, 20 Feb 2025 02:28:08 +0000 (11:28 +0900)
commitd895d9310178cc1f447b90fa89cb850ebf7b8088
tree059726368c757b5e4b58ed2b9e3648f0461e51fd
parent4af8ae409aca95cc419c9440ad4d16d3922e6e60
gitlab CI: don't run MR pipelines in forks

Commit originally by Simon Ser in wayland/wayland-protocols!305.

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: Peter Hutterer <peter.hutterer@who-t.net>
.gitlab-ci.yml
.gitlab-ci/ci.template