From 27115c68a1f3a2eeaae0305bac37abe4d1e9e6e1 Mon Sep 17 00:00:00 2001 From: proletarius101 Date: Tue, 1 Nov 2022 14:36:03 +0800 Subject: [PATCH] Revert "Revert "prevent duplicate pipelines in MRs"" This reverts commit b6144cbbc517971ef73f28a3c44b07a47f7e8bfd. --- .gitlab-ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a1c45e0f33..b9c97704ce 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,11 +1,13 @@ include: - template: Security/SAST.gitlab-ci.yml -# copied from https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Workflows/MergeRequest-Pipelines.gitlab-ci.yml workflow: rules: # required to enable merge request pipelines: https://docs.gitlab.com/ee/ci/pipelines/merge_request_pipelines.html#prerequisites - - if: $CI_MERGE_REQUEST_IID + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + # to prevent duplicate pipelines in MRs: https://docs.gitlab.com/ee/ci/yaml/workflow.html#switch-between-branch-pipelines-and-merge-request-pipelines + - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS + when: never - if: $CI_COMMIT_TAG - if: $CI_COMMIT_BRANCH