What Is CI_COMMIT_REF_NAME?
CI_COMMIT_REF_NAME is the branch or tag name that the pipeline is building.
CI_COMMIT_REF_NAME gives you the human-friendly ref name for conditionals, environment naming, and slugged URLs.
Note
For a value safe in URLs and Kubernetes names, use CI_COMMIT_REF_SLUG, which lowercases and sanitizes the name.
Key takeaways
- CI_COMMIT_REF_NAME is the branch/tag name.
- CI_COMMIT_REF_SLUG is the URL-safe form.
- Useful for rules and naming.
Related guides
What Is CI_COMMIT_BRANCH?CI_COMMIT_BRANCH is the branch name in a GitLab CI branch pipeline. Learn when it is set versus empty.
What Is CI_COMMIT_TAG?CI_COMMIT_TAG is the tag name in a GitLab CI tag pipeline. Learn how to trigger release jobs with it.
What Is a Git Branch?What is a Git branch? Learn how branches are lightweight movable pointers, how they enable parallel work, and…