Link to Artifacts of Child Pipeline

Hi,

I want to link to the latest version of an artifact that was created by a child pipeline.
I know that this should be possible by the link template:
https://example.com/<namespace>/<project>/-/jobs/artifacts/<ref>/raw/<path_to_file>?job=<job_name>

However that does not seem to work for me if the artifact is created from a job inside a child pipeline.
I have created a repo with minimal configuration to test this. The repo contains the following files:

.gitlab-ci.yml:

stages:
    - artifact_test

hello:
    stage: artifact_test
    script:
        - echo "hello" > hello.txt
    artifacts:
        paths:
            - hello.txt

world_trigger:
    stage: artifact_test
    trigger:
        include: .artifact.yml

.artifact.yml:

stages:
    - build

world:
    stage: build
    script:
        - echo "world" > world.txt
    artifacts:
        paths:
            - world.txt

I can now download hello.txt from https://example.com/<namespace>/<project>/-/jobs/artifacts/master/raw/hello.txt?job=hello but I cannot download world.txt from https://example.com/<namespace>/<project>/-/jobs/artifacts/master/raw/world.txt?job=world

How do I need to change the URL?
Thanks for any help!

Hi,

since I have not found a solution so far I have recreated the repository publicly here: https://gitlab.com/FranzAtGitLab/link-to-artifacts-of-child-pipeline.

The configuration in this repository is exactly the same apart for some name of jobs/stages ect.
I thought I could edit my initial post so that it would fit but I could not find any edit button.

I am quite confused to why no one did reply to my initial post as I thought it would be an easy problem. Well … maybe it is to obvious to answer? Or is my question is not clear enough?
I hope the availability of the public repository helps.

Also, if you know a better place to post my question please let me know.

I was pointed to this issue (https://gitlab.com/gitlab-org/gitlab/-/issues/201784) that deals with the same problem.

1 Like