From 7bdef15e85c4754049e48d35daaee89db64e42e7 Mon Sep 17 00:00:00 2001 From: Fu Hanxi Date: Fri, 25 Sep 2020 16:14:05 +0800 Subject: [PATCH] CI: Disable pipelines generated by push on dev branches --- .gitlab-ci.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 06008242b0..8346bed79c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,6 +8,18 @@ stages: - deploy - post_check +# pipelines will not be created in such two cases: +# 1. MR push +# 2. push not on "master/release" branches, and not tagged +# This behavior could be changed after the `rules: changes` feature is implemented +workflow: + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' + when: never + - if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^v\d+\.\d+(\.\d+)?($|-)/ && $CI_PIPELINE_SOURCE == "push"' + when: never + - when: always + variables: # System environment