ci: add general pipeline create rules

- If a commit message starts with "test ci", push commit will trigger a
pipeline

- If an MR title starts with "WIP:" or "Draft:", push commit will NOT
trigger a pipeline

- If a commit message starts with "WIP:" or "Draft:", push commit will
NOT trigger a pipeline
This commit is contained in:
Fu Hanxi 2021-02-09 12:34:55 +08:00
parent 80e86e7939
commit 86287504ba

View File

@ -13,6 +13,12 @@ workflow:
# Disable those non-protected push triggered pipelines
- if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^v\d+\.\d+(\.\d+)?($|-)/ && $CI_PIPELINE_SOURCE == "push"'
when: never
- if: '$CI_COMMIT_TITLE =~ /^test[ _]ci:/'
when: always
- if: '$CI_MERGE_REQUEST_IID && $CI_MERGE_REQUEST_TITLE =~ /^wip|draft:/i'
when: never
- if: '$CI_COMMIT_TITLE =~ /^wip|draft/i'
when: never
- when: always
variables: