GitLab API

GitlabTool

Actions1095

Projects → getApiV4ProjectsIdJobsArtifactsRefNameRaw*artifactPath

AI-generated

Summary

Retrieve a specific file from the artifacts archive of a job in a GitLab project at a given branch or tag reference.

Inputs

  • id (required) — The ID or URL-encoded path of the GitLab project to access.
  • ref_name (required) — The branch or tag name in the repository to specify the job artifacts' reference; HEAD or SHA references are not supported.
  • job (required) — The name of the job that produced the artifacts.
  • artifact_path (required) — The path to the file inside the job's artifacts archive to retrieve.
  • job_token — Optional token for multi-project pipeline triggers, available on GitLab Premium and Ultimate tiers.
  • method — HTTP method to use for the request; defaults to GET.
  • baseUrl — Base URL of the GitLab instance; defaults to https://gitlab.com.
  • skipAuthentication — Option to skip authentication; defaults to false.

Output shape

binary file content of the specified artifact path

Returns the raw file content located at the specified artifact path within the job's artifacts archive. If the file or job does not exist, the API will return an error. The HTTP method can be customized but typically is GET. The response is non-paginated and does not include additional metadata.

Examples

Example 1: Fetch a log file named 'build.log' from the artifacts of job 'build-job' in project with ID '123' on branch 'main'.

Set 'id' to '123', 'ref_name' to 'main', 'job' to 'build-job', and 'artifact_path' to 'build.log'. Leave authentication enabled unless skipping is required.

Links

Discussion