Commit 129912eb authored by Nick's avatar Nick

Highlight non-recursion of `artifacts:exclude`

The file-matching syntax of `artifacts:paths` and `artifacts:exclude`
seem (and are) similar, but `exclude` differs in that it does not
include directory contents recursively. This can lead to confusion when
attempting to exclude the contents of a subdirectory by matching that
subdirectory's path. Explain this caveat in the docs and add a relevant
example.

See https://gitlab.com/gitlab-org/gitlab/-/issues/15122#note_524690377
for an example of this issue in the wild.
parent a7ca3737
...@@ -3283,6 +3283,18 @@ artifacts: ...@@ -3283,6 +3283,18 @@ artifacts:
- binaries/**/*.o - binaries/**/*.o
``` ```
Unlike [`artifacts:paths`](#artifactspaths), `exclude` paths are not recursive. To exclude all of the contents of a directory, you can match them explicitly rather than matching the directory itself.
For example, to store all files in `binaries/` but nothing located in the `temp/` subdirectory:
```yaml
artifacts:
paths:
- binaries/
exclude:
- binaries/temp/**/*
```
Files matched by [`artifacts:untracked`](#artifactsuntracked) can be excluded using Files matched by [`artifacts:untracked`](#artifactsuntracked) can be excluded using
`artifacts:exclude` too. `artifacts:exclude` too.
......
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