Use actions/upload-artifact@v7 to upload individual files, entire directories, or files matching wildcard patterns.
- Individual Files: Provide the specific file path. Use
archive: false to upload the file unzipped. - Directories: Provide the directory path. The hierarchy within the directory is preserved.
- Wildcards: Supports glob patterns (e.g.,
path/**/[abc]rtifac?/*). Note that the path hierarchy is preserved after the first wildcard pattern, which may result in a flattened structure. - Multiple Paths: You can provide multiple paths using YAML multiline syntax. If multiple paths are provided, the least common ancestor of all search paths is used as the root directory. You can use
! to exclude specific patterns. - Relative vs Absolute: Relative paths are rooted against the current working directory. Absolute paths are also supported.
### Upload an Individual File (Zipped)
```yaml
steps:
- run: mkdir -p path/to/artifact
- run: echo hello > path/to/artifact/world.txt
- uses: actions/upload-artifact@v7
with:
name: my-artifact
path: path/to/artifact/world.txt
Upload an Individual File (Unzipped)
steps:
- run: mkdir -p path/to/artifact
- run: echo hello > path/to/artifact/world.txt
- uses: actions/upload-artifact@v7
with:
path: path/to/artifact/world.txt
archive: false
Upload an Entire Directory
- uses: actions/upload-artifact@v7
with:
name: my-artifact
path: path/to/artifact/ # or path/to/artifact
Upload using a Wildcard Pattern
- uses: actions/upload-artifact@v7
with:
name: my-artifact
path: path/**/[abc]rtifac?/*
Upload using Multiple Paths and Exclusions
- uses: actions/upload-artifact@v7
with:
name: my-artifact
path: |
path/output/bin/
path/output/test-results
!path/**/*.tmp