API endpoint to download job artifacts within a project by the name

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

  • Close this issue

Problem to solve

Downloading artifacts requires the pipeline that they were created in, to have been run for a particular tag that I want to download for. This is a real pain and means I have to break my pipelines up in quite an ugly fashion.

Currently my pipelines look something like this:

  1. TAG ALPHA (triggered by feature/ branch)
  2. Build & deploy alpha (triggered by alpha pre-release tag, e.g. 1.0.0-alpha)
  3. TAG RC (triggered by master branch)
  4. Build, deploy and TAG RELEASE (triggered by rc pre-release tag, e.g. 1.0.0-rc)
  5. TAG HOTFIX (triggered by hotfix/ branch)
  6. Build, deploy (triggered by hotfix pre-release tag, e.g. 1.0.0-hotfix)
  7. Rollback (triggered by no pre-release tag, e.g. 1.0.0)

I want to combine pipelines 1 with 2, 3 with 4, 5 with 6. But I can't because then I wouldn't be able to download the artifacts from the GitLab API because the pipelines would not have run with the tag as the ref.

This is a problem because:

  • It really complicates my CI configuration.
  • The pipeline page looks messy with lots of tagging pipelines with single job that kicks off the next pipeline.
  • It massively slows down my pipelines because the tag jobs wait in a long queue and once they finish the next pipeline is generated and the new set of jobs are then placed in the queue.

Intended users

Devon (DevOps Engineer) Sasha (Software Developer)

Further details

Much simpler pipelines.

Proposal

If you can add an API endpoint to download the artifacts by some other means, like the artifact name, then I wouldn't need to create these complicated pipelines. The endpoint would return the latest-uploaded artifacts with that name.

CI configuration for a job that creates the artifacts:

job:
  artifacts:
    name: "1.0.0"
    paths:
      - binaries/

API endpoint: https://gitlab.example.com/api/v4/projects/1/artifacts/1.0.0

This doesn't have to work using the name property of artifacts. I am basically just looking for a way to uniquely tag artifacts and then later download them from the API without first needing the pipeline for creating the artifacts to be identified by the git ref.

Permissions and Security

The same security would apply as the existing API endpoints for downloading the artifacts for a job.

Links / references

Edited Jun 29, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading