mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-26 11:51:02 +00:00
docs: clearer explanation for globs in when:path (#2252)
As discussed on [discord](https://discord.com/channels/838698813463724034/838698813463724037/1142646908049961001).
This commit is contained in:
parent
008a8c6acb
commit
d00932bedd
1 changed files with 10 additions and 3 deletions
|
@ -423,14 +423,21 @@ Path conditions are applied only to **push** and **pull_request** events.
|
||||||
It is currently **only available** for GitHub, GitLab and Gitea (version 1.18.0 and newer)
|
It is currently **only available** for GitHub, GitLab and Gitea (version 1.18.0 and newer)
|
||||||
:::
|
:::
|
||||||
|
|
||||||
Execute a step only on a pipeline with certain files being changed:
|
Execute a step only when certain files were changed:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
when:
|
when:
|
||||||
- path: "src/*"
|
- path: "src/*.js"
|
||||||
```
|
```
|
||||||
|
|
||||||
You can use [glob patterns](https://github.com/bmatcuk/doublestar#patterns) to match the changed files and specify if the step should run if a file matching that pattern has been changed `include` or if some files have **not** been changed `exclude`.
|
One can also use [glob patterns](https://github.com/bmatcuk/doublestar#patterns):
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
when:
|
||||||
|
- path: "src/**/*.js"
|
||||||
|
```
|
||||||
|
|
||||||
|
To match whether the files have been changed or not changed, use `include` or `exclude` respectively:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
when:
|
when:
|
||||||
|
|
Loading…
Reference in a new issue