Download an artifact
List the files a run uploaded and download one before it expires.
A run uploads artifacts with an artifact step in the native format (see
Workflow syntax) or with actions/upload-artifact (v4 and later) in a
GitHub-syntax workflow. An artifact can be downloaded for the days the workflow asks for, 1 to 90,
and 30 when it does not say.
Replace run-id with the run's id, artifact-id with the artifact's id and artifact-file with the file to save it to.
Prerequisites
ci:ListArtifactson the run's repository (rn:ews::<organization id>:ci:repository/<repository id>) to list them.ci:DownloadArtifacton it to download one. It is marked sensitive: the read-only policies do not include it, and a refused download is recorded in the audit log.- In the console, also
git:GetRepository,ci:ListRunsandci:GetRunon the repository to open the run; without them the page is not found.
Download it
- Open the repository, then open its CI tab.
- Open the run.
- Under Artifacts, choose Download next to the artifact. The section appears once the run has uploaded an artifact.
An expired artifact reads Expired; without ci:DownloadArtifact the row reads No access.
dcloud ci artifacts list run-id
dcloud ci artifacts download artifact-id > artifact-filedownload writes the artifact's raw bytes to standard output, so redirect it to a file.
GET /ci/api/runs/run-id/artifactsGET /ci/api/artifacts/artifact-id/downloadThe list gives each artifact's id, name, sizeBytes, expiresAt and createdAt. The download
answers 302 to a storage link valid for five minutes.
Result
You have the artifact's file.
410"This artifact has expired" once it is pastexpiresAt.404when the run or the artifact is not in your organization.