Read CICD predefined job variable names

Hi Guys,

I am really new to Git & GitLab. My aim is to create few CICD jobs which should run when a commit happens on a particular branch. I was going through few topics & videos for the last 2 weeks and come up with yaml file which actually runs now and build some files. My current requirement is to get few parameters like the commited branch name, commited files and then download these files to a remote system. I have gone through the CICD variables and tried to echo these variables to see the values.
echo $CI_COMMIT_REF_NAME simply echoes the same value in the CICD job console.

How can we get this value? Any pointers is highly appreciated.

Thanks in advance!

This should be the full reference guide: .
Otherwise you might be able to set something up with
Or do you mean it echos literally: ‘$CI_COMMIT_REF_NAME’ ?

it should be passed to the runner, and usable in a script section:

- cp mytestfile.txt $CI_COMMIT_REF_NAME

I got my issue…it was a syntax issue and needs to change according to the runner.
I fix that issue but getting a null value when i read CI_COMMIT_REF_NAME variable.

Below is sample output

Running with gitlab-runner 11.6.0 (f100a208)
on iib-dedictaed-server-description 28fnufWA
Using Shell executor…
Running on DESKTOP-9VN35R5…
Fetching changes…
HEAD is now at 6eefa47 Update .gitlab-ci.yml
6eefa47…e1d018c dev -> origin/dev
Checking out e1d018c1 as dev…
Skipping Git submodules setup
$ echo vAR1:%CI_COMMIT_REF_NAME% vAR1: call C:\Users\abhi\IBM\IIBT10\GitRepo\cicd.bat


Press any key to continue . . .
Job succeeded

ah, was assuming bash syntax, not that experienced with windows shell commands/variables. Sorry, I’m afraid I’m not the person that can help you here.