Reputation: 463
how can I find out branch name in a job that is running in the pipeline? I tried git branch all i get is * (detached from <commit number>) master
git branch
* (detached from <commit number>) master
Upvotes: 3
Views: 1213
There is a predefined variable called CI_COMMIT_REF_NAME that contains branch name. for more info here
CI_COMMIT_REF_NAME
Upvotes: 4