ci: Add "is master branch of main project" YAML anchor

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6566>
This commit is contained in:
Michel Dänzer 2020-09-08 12:20:39 +02:00 committed by Marge Bot
parent c3ae82be24
commit ac56d66992
1 changed files with 10 additions and 1 deletions

View File

@ -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