GItlab CI / CD get branch name

Hello,

I would like to get the branch name when launching a CI.

And I can’t get it at all, I get with the CI_COMMIT_REF_NAME command the tag but not the branch name

Is it possible to do it?

Hi @Alex78

For branch pipelines: CI_COMMIT_REF_NAME or CI_COMMIT_REF_SLUG
For tag pipelines: CI_COMMIT_REF_NAME or CI_COMMIT_REF_SLUG
For MR pipelines: CI_MERGE_REQUEST_SOURCE_BRANCH_NAME

Description and all variables are documented here Predefined variables reference | GitLab