diff options
author | Marcel Amirault <mamirault@gitlab.com> | 2021-02-18 08:58:24 +0300 |
---|---|---|
committer | Evan Read <eread@gitlab.com> | 2021-02-18 08:58:24 +0300 |
commit | 115979003df6e87fc3dd218caa603d4d261243b1 (patch) | |
tree | 352c7f9920cc33630e27f335025688cc1f6fea5e /.gitlab-ci.yml | |
parent | d9358b8854c8f71195f9e64c4e2a51ed91d4a3a4 (diff) |
Add initial workflow rules
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: |