In my Gitlab CI, I have a stage that triggers another stage by api call trigger and I want to pass the current branch name as parameter to the other project holding the trigger. I used the CI_COMMIT_REF_NAME
for this, it seemed to work, but now that I call the stage only when merging the branch to master, the CI_COMMIT_REF_NAME
always says "master".
In the documentation it says "The branch or tag name for which project is built", do I understand it correctly that it kind of holds the target branch of my working branch?
I tried to get the current branch in gitlab ci with git symbolic-ref HEAD | sed 's!refs\/heads\/!!'
as well but it was empty.
Is CI_COMMIT_REF_NAME
the variable I am looking for and something is going wrong or do I need something else?
Thanks in advance.