Commit 7193a1af authored by drew's avatar drew Committed by drew cimino

Apply suggestions to doc/ci/yaml/README.md

parent a28ddb46
......@@ -728,18 +728,18 @@ Learn more about [variables expressions](../variables/README.md#environment-vari
Using the `changes` keyword with `only` or `except` makes it possible to define if
a job should be created based on files modified by a Git push event.
This means the `only:changes` policy is only useful for pipelines with:
This means the `only:changes` policy is useful for pipelines where:
- `$CI_PIPELINE_SOURCE == 'push'`
- `$CI_PIPELINE_SOURCE == 'merge_request_event'`
- `$CI_PIPELINE_SOURCE == 'external_pull_request_event'`
If there is no Git push event, as is the case in pipelines with
[any other source](../variables/predefined_variables.html#variables-reference),
If there is no Git push event, such as for pipelines with
[sources other than the three above](../variables/predefined_variables.html#variables-reference),
`changes` cannot determine if a given file is new or old, and will always
return true.
For example:
A basic example of using `only: changes`:
```yaml
docker build:
......@@ -920,14 +920,9 @@ at all, the behavior defaults to `job:when`, which continues to default to
#### `rules:changes`
`changes` works exactly the same way as [`only`/`except`](#onlychangesexceptchanges),
accepting an array of paths. This includes the caveat about using `changes:` in
pipelines that do not have an associated Git push event.
CAUTION: **Warning:**
Pipelines triggered via `web`, `trigger`, `schedule`, `api`, `external`,
`pipeline`, or `chat`, the pipeline **will have no modified paths and `changes`
clauses will always evaluate to true**.
`rules: changes` works exactly the same way as `only: changes` and `except: changes`,
accepting an array of paths. Similarly, it will always return true if there is no
Git push event. See [`only/except: changes`](#onlychangesexceptchanges) for more information.
For example:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment