From ac56d6699270c0027563c3311fa8a5b418b481d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Tue, 8 Sep 2020 12:20:39 +0200 Subject: [PATCH] ci: Add "is master branch of main project" YAML anchor Acked-by: Pierre-Eric Pelloux-Prayer Part-of: --- .gitlab-ci.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 39e710307ef..1508a33c602 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,6 +40,15 @@ stages: if: &is-scheduled-pipeline '$CI_PIPELINE_SOURCE == "schedule"' when: never +# YAML anchors for rule conditions +# -------------------------------- +.rules-anchors: + rules: + # Pipeline runs for the master branch of the main project + - if: &is-main-master '$CI_PROJECT_NAMESPACE == "mesa" && $CI_COMMIT_REF_NAME == "master"' + when: always + + .docs-base: extends: .ci-run-policy image: alpine @@ -56,7 +65,7 @@ pages: - public rules: - *ignore_scheduled_pipelines - - if: '$CI_PROJECT_NAMESPACE == "mesa" && $CI_COMMIT_REF_NAME == "master"' + - if: *is-main-master changes: &docs-or-ci - docs/**/* - .gitlab-ci.yml