actions/upload-artifact
Upload files from a job so other jobs or a person can download them after the run.
What it does
actions/upload-artifact persists files produced by a job so a later job can download them or a human can grab them from the run summary.
v4 rewrote the backend for speed and immutability, and it is not cross-compatible with v3: both ends of an upload/download pair must be on v4.
Usage
steps:
- uses: actions/upload-artifact@v4
with:
name: test-results
path: reports/
retention-days: 7Inputs
| Input | Description | Default | Required |
|---|---|---|---|
name | Artifact name. | artifact | No |
path | File, directory, or glob to upload. | - | Yes |
if-no-files-found | Behavior when nothing matches: warn, error, or ignore. | warn | No |
retention-days | Days to keep the artifact (up to the repo maximum). | repo default | No |
overwrite | Replace an existing artifact of the same name. | false | No |
Outputs
| Output | Description |
|---|---|
artifact-id | Numeric id of the uploaded artifact. |
artifact-url | URL of the artifact in the run. |
Notes
In v4 an artifact name is immutable within a run. Uploading the same name twice fails unless overwrite: true.
To collect artifacts from a matrix, give each leg a unique name (for example include the matrix value) and merge on download.
Common errors
Conflict: an artifact with this name already exists on the workflow run(v4) means a duplicate name. Use unique names oroverwrite: true.- Mixing
upload-artifact@v4withdownload-artifact@v3(or vice versa) fails. Keep both on v4.
Security and pinning
- Artifacts are downloadable by anyone with read access to the repo. Never upload secrets, tokens, or
.envfiles.
Alternatives and related
Frequently asked questions
What changed in upload-artifact v4?
How long are artifacts kept?
retention-days.