Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'doc/ci/yaml/workflow.md')
-rw-r--r--doc/ci/yaml/workflow.md22
1 files changed, 12 insertions, 10 deletions
diff --git a/doc/ci/yaml/workflow.md b/doc/ci/yaml/workflow.md
index b46d504edfa..a985db14d08 100644
--- a/doc/ci/yaml/workflow.md
+++ b/doc/ci/yaml/workflow.md
@@ -38,7 +38,7 @@ workflow:
rules:
- if: $CI_COMMIT_MESSAGE =~ /-draft$/
when: never
- - if: '$CI_PIPELINE_SOURCE == "push"'
+ - if: $CI_PIPELINE_SOURCE == "push"
```
This example has strict rules, and pipelines do **not** run in any other case.
@@ -50,9 +50,9 @@ All other pipeline types run. For example:
```yaml
workflow:
rules:
- - if: '$CI_PIPELINE_SOURCE == "schedule"'
+ - if: $CI_PIPELINE_SOURCE == "schedule"
when: never
- - if: '$CI_PIPELINE_SOURCE == "push"'
+ - if: $CI_PIPELINE_SOURCE == "push"
when: never
- when: always
```
@@ -81,18 +81,20 @@ but does not run pipelines for any other case. It runs:
```yaml
workflow:
rules:
- - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- - if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS'
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event"
+ - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- - if: '$CI_COMMIT_BRANCH'
+ - if: $CI_COMMIT_BRANCH
```
-If the pipeline is triggered by:
+If GitLab attempts to trigger:
-- A merge request, run a merge request pipeline. For example, a merge request pipeline
+- A merge request pipeline, start the pipeline. For example, a merge request pipeline
can be triggered by a push to a branch with an associated open merge request.
-- A change to a branch, but a merge request is open for that branch, do not run a branch pipeline.
-- A change to a branch, but without any open merge requests, run a branch pipeline.
+- A branch pipeline, but a merge request is open for that branch, do not run the branch pipeline.
+ For example, a branch pipeline can be triggered by a change to a branch, an API call,
+ a scheduled pipeline, and so on.
+- A branch pipeline, but there is no merge request open for the branch, run the branch pipeline.
You can also add a rule to an existing `workflow` section to switch from branch pipelines
to merge request pipelines when a merge request is created.