37 lines
1.2 KiB
Markdown
37 lines
1.2 KiB
Markdown
# upload-artifact
|
|
|
|
Upload files as a Forgejo Actions artifact. Thin wrapper around `forgejo/upload-artifact` pinned to a specific commit SHA to prevent supply chain attacks.
|
|
|
|
## Inputs
|
|
|
|
| Input | Required | Default | Description |
|
|
|-------|----------|---------|-------------|
|
|
| `name` | Yes | — | Artifact name |
|
|
| `path` | Yes | — | File or directory path to upload |
|
|
| `retention-days` | No | `30` | Number of days to retain the artifact |
|
|
| `if-no-files-found` | No | `warn` | Behaviour when no files are found — `warn`, `error`, or `ignore` |
|
|
|
|
## Usage
|
|
|
|
```yaml
|
|
- uses: https://schmalz-git.git.onstackit.cloud/schmalz/shared-actions/upload-artifact@upload-artifact-v1
|
|
with:
|
|
name: my-artifact
|
|
path: dist/
|
|
```
|
|
|
|
Upload and ignore if no files exist:
|
|
|
|
```yaml
|
|
- uses: https://schmalz-git.git.onstackit.cloud/schmalz/shared-actions/upload-artifact@upload-artifact-v1
|
|
with:
|
|
name: blob-report-${{ matrix.shard-index }}
|
|
path: frontend/blob-report/
|
|
retention-days: 3
|
|
if-no-files-found: ignore
|
|
```
|
|
|
|
## Notes
|
|
|
|
- Wraps `forgejo/upload-artifact` v4 (node20), compatible with Ubuntu 22 runners.
|
|
- The underlying action is pinned to a commit SHA rather than a mutable tag to prevent supply chain attacks.
|