From 7fa72645e5b4eebf299ebdb16b83be4e242b8822 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 13 Apr 2023 15:03:16 +0200 Subject: gitlab-ci: make detached MR pipeline for external contributor's pipelines to run The permissions for running CI will be restricted to external contributors. It will only work for projects that use "detached MR pipelines" ([1]). Note that for it to actually work, a member with permission might have to go to the "pipeline" tab of the merge request and click "run pipeline". But this snippet is necessary for that. [1] https://docs.gitlab.com/ee/ci/pipelines/merge_request_pipelines.html https://gitlab.freedesktop.org/freedesktop/freedesktop/-/issues/540#what-it-means-for-me-a-maintainer-of-a-project-part-of-gitlabfreedesktoporg --- .gitlab-ci/ci.template | 7 +++++++ 1 file changed, 7 insertions(+) (limited to '.gitlab-ci') diff --git a/.gitlab-ci/ci.template b/.gitlab-ci/ci.template index a62e9e58e4..a9bb6d4f47 100644 --- a/.gitlab-ci/ci.template +++ b/.gitlab-ci/ci.template @@ -286,3 +286,10 @@ triage:issues: - gitlab-triage -d --token $API_TOKEN --source-id $SOURCE_ID only: - schedules + +# Have detached MR pipeline (https://docs.gitlab.com/ee/ci/pipelines/merge_request_pipelines.html) +# https://gitlab.freedesktop.org/freedesktop/freedesktop/-/issues/540#what-it-means-for-me-a-maintainer-of-a-project-part-of-gitlabfreedesktoporg +workflow: + rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' + - if: $CI_PIPELINE_SOURCE == 'push' -- cgit v1.2.1