Static link to artifacts for latest pipeline

According to the docs – there is a static endpoint that can be used to download artifacts for the latest successful pipeline

https://docs.gitlab.com/ee/user/project/pipelines/job_artifacts.html#downloading-the-latest-artifacts

https://example.com/<namespace>/<project>/-/jobs/artifacts/<ref>/raw/<path_to_file>?job=<job_name>

This URL is useful for showing custom badges created by jobs. Unfortunately, since this endpoint resolves to the latest successful pipeline, it can’t be used to show “failed” badges when a job fails on a pipeline.

Is there a static endpoint that can be used to download artifacts from the latest Pipeline, regardless of whether it succeeded or not?

From the second paragraph of your link:

The artifacts will be uploaded when the job succeeds by default, but can be set to upload when the job fails, or always, if the artifacts:when parameter is used.

1 Like

Unfortunately the feature doesn’t work and there’s an open bug. And example is currently visible at Files · setup-ci · NamingThingsIsHard / media_tools / mk_badge · GitLab

artifacts:when: always doesn’t help

Any of the links at Job artifacts | GitLab fails for CURL using -L flag. It downloads the cloudfare debounce page.