diff options
author | Evan Read <eread@gitlab.com> | 2021-02-18 08:58:25 +0300 |
---|---|---|
committer | Evan Read <eread@gitlab.com> | 2021-02-18 08:58:25 +0300 |
commit | 5935d55ceef71b146f5875798cf621f9d54ad13a (patch) | |
tree | a9e7919245a2999c250a5696436cec5cc6dc463b /.gitlab-ci.yml | |
parent | fef95ee056aa1f3c3ec4978dc945687ddfd01757 (diff) | |
parent | 115979003df6e87fc3dd218caa603d4d261243b1 (diff) |
Merge branch 'docs-project-workflow-rules' into 'master'
Add initial workflow rules
See merge request gitlab-org/gitlab-docs!1532
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r-- | .gitlab-ci.yml | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7b2961c0..70fc9016 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -42,6 +42,22 @@ variables: retry: 2 # +# workflow:rules to prevent duplicate pipelines when pushing to a branch with an open MR. +# +workflow: + rules: + # Prevent branch pipelines if an MR is open on the branch. + - if: $CI_COMMIT_BRANCH && $CI_PIPELINE_SOURCE == "push" && $CI_OPEN_MERGE_REQUESTS + when: never + # Allow merge request and scheduled pipelines. + - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' + - if: '$CI_PIPELINE_SOURCE == "schedule"' + # Allow branch pipelines for the default branch, stable branches named XX.X, and review app branches. + - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' + - if: '$CI_COMMIT_BRANCH =~ /^\d{1,2}\.\d{1,2}$/' + - if: '$CI_COMMIT_BRANCH =~ /docs-preview/' + +# # Rules to determine which pipelines jobs will run in. # .rules_scheduled: |