But when running it shows ci/$CI_COMMIT_REF_SLUG in the jobs and environment view. While I expect e.g. ‘ci/master’. The script itself seems to work fine, but I can not make distinction between different runs on different branches. Anyone an idea why this occurs?
I wonder whether it’s because you are using $CI_COMMIT_REF_NAME rather than $CI_COMMIT_REF_SLUG which escapes the text in the commit name, and is safe to use in URLs?
Nope I want to use a variable in environment.name. Reason is that I want to trigger the pipeline and give as variable input the environment I want to create and the default must be the branch name itself.
Yes, but CI_COMMIT_BRANCH is a predefined variable which I can not provide during start of the pipeline. The example I provided is exactly what I need.
Sorry, @dkwakkel I’m obviously very confused. What’s the reason for giving CI_COMMIT_REF_SLUG an alias? Normally we would just use those variables as they are in the CI configs?