Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get the name of the current branch in Gitlab CI

I'm setting up Gitlab CI job. I want to get the name of the current branch from a Gitlab CI job. How can I do this?

like image 392
Oddamati Avatar asked Oct 15 '25 23:10

Oddamati


1 Answers

In GitLab 9.0 and above, you have a predefined CI_COMMIT_REF_NAME environment variable you can use in your jobs.

like image 123
Mureinik Avatar answered Oct 17 '25 13:10

Mureinik