I have read GitLab's Use CI/CD Variables to Define Artifact Name documentation and examples.
In the following excerpt of my .gitlab-ci.yml
file, I try to replicate their powershell example:
artifacts:
name: "$env:CI_JOB_STAGE-$env:CI_COMMIT_REF_NAME"
expire_in: 1 week
paths:
- My\Hardcoded\Path\*
But when I download the artifact, it's named: _env_CI_JOB_STAGE-_env_CI_COMMIT_REF_NAME.zip
. I wanted to use a variable for my artifact path, but that didn't work either, so I was forced to hardcode it. What am I doing wrong?
I'm familiar with the open GitLab issue: Artifacts Filename Cannot Be Set with Dynamic Variables, and I would eventually like to put a date & timestamp in the artifact name, but first I'd just like to get any variable working.
I'm using GitLab v15.1.1-ee. My runner is v15.1.1, installed in Windows and uses a shell executor in powershell.
Per Ville Laurikari's comment, it appears this was a bug affecting v15.1.1. Today, I noticed that our GitLab instance was upgraded to v15.1.2-ee, and I replaced my runner with v15.1.0. The variables now work as documented.