I have a job the compresses files from a repo when a new tag is pushed and makes that compressed file available as an artifact. I want to use new tags to trigger the job and use a static curl command to download the latest artifact regardless of tag name.
This is the curl command to download the artifact:
curl -L --header "PRIVATE-TOKEN: <private-access-token>"
"https://gitlab.com/api/v4/projects/<proj_id>/jobs/artifacts/<tag_name>/raw/deploy.tar.gz?job=publish-job" >> deploy.tar.gz
Notice the tag_name in the url changes with each new tag. How can I reference the branch main
in the url instead of the tag?
Is there a way to make the gitlab runner execute as the branch ref instead of the tag ref?