Getting pipeline reports for latest pipeline in branch

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

I'm having trouble obtaining a link or API endpoint to achieve the following scenario.

I have a pipeline that, on branch "develop", runs some security jobs. For example the secret_detection job from the template Security/Secret-Detection.gitlab-ci.yml. After it's completed I get a link like "https://my-gitlab-instance/my-project-path/-/jobs/9379/artifacts/download?file_type=secret_detection".

This is fine but I'd like to be able to access this artifact without requiring the job_id. I should be able to get this artifact for the latest pipeline on my selected branch even if I have to provide the job name. For example:

At the moment none of those links work even though they work for normal artifacts.

Also I tried capturing this artifact report in a job that runs after secret_detection job with the keywords needs and artifacts: true and the artifact file is nowhere to be found.

Edited by 🤖 GitLab Bot 🤖