GH-200 - Consume and troubleshoot workflows - Section 2.4

Locate, download and manage workflow logs and artifacts through the user interface and the REST API.

Locate and download workflow logs and artifacts via the GitHub UI and the REST API. Manage artifact retention periods and understand the default expiry policy.

download artifactsworkflow logsREST APIartifact retention

Practice question for this objective

Free sampleConsume and troubleshoot workflowsmedium

An automation script lists a workflow run's artifacts over REST, obtains an artifact identifier, and now needs to fetch the artifact's actual contents as a zip file for further processing. The script already holds the owner, repository and artifact identifier. Which REST API request downloads the artifact content?

GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/<format>
  • ASend GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/zip, because that endpoint redirects to a short-lived URL that serves the artifact's contents as a downloadable zip file. Correct
  • BSend GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id} on its own, because requesting an artifact by identifier without a format returns its binary contents directly as a zip in the response body.
  • CSend POST /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/zip, because creating a download request with POST is required before GitHub will package the artifact into a zip for retrieval.
  • DSend GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts/zip, because the run-scoped artifacts path bundles every artifact for the run into one combined zip download.
Download an artifact's contents over REST by calling the artifact endpoint with the zip archive format, which redirects to a temporary download. The Download an artifact endpoint, GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/zip, returns a redirect to a short-lived URL that serves the artifact packaged as a zip, so it delivers the contents the script must process. Requesting the artifact by identifier without the format yields JSON metadata, POST is not a valid method for this download, and there is no run-scoped combined-zip endpoint of that form.

Why A is correct: The download artifact endpoint with the zip archive format responds with a redirect to a temporary URL that streams the artifact as a zip, which is exactly what the script needs for processing.

Why B is wrong: Tempting because this path identifies the artifact, but without the archive format it returns JSON metadata such as size and expiry, not the artifact's downloadable contents.

Why C is wrong: Tempting because some downloads use a two-step request, but artifact retrieval is a single GET and POST is not accepted here, so this request fails rather than returning the zip.

Why D is wrong: Tempting because it mixes real path segments, but no such combined run-level zip endpoint exists, and the script holds an artifact identifier rather than a run identifier anyway.

See more GH-200 practice questions, answers explained.

More in this domain

Back to all Consume and troubleshoot workflows objectives, or the GH-200 cert hub.

Examworthy is not affiliated with or endorsed by GitHub. Original, blueprint-aligned practice material only.