Oddamati
Oddamati

Reputation: 183

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?

Upvotes: 4

Views: 3732

Answers (1)

Mureinik
Mureinik

Reputation: 310993

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

Upvotes: 5

Related Questions