What Is CI_COMMIT_TAG?
CI_COMMIT_TAG is the Git tag name, set only when a pipeline runs for a tag.
CI_COMMIT_TAG is how a GitLab pipeline knows it is building a release, so release and publish jobs can be gated on it.
Example rule
Run a job only for tags.
yaml
rules:
- if: '$CI_COMMIT_TAG'Key takeaways
- CI_COMMIT_TAG is set only on tag pipelines.
- Use it to trigger release jobs.
- Empty on branch pipelines.
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 a Release Tag?What is a release tag? Learn how version tags mark shippable commits, how semantic versioning structures them…
What Is CI_PIPELINE_SOURCE?CI_PIPELINE_SOURCE is how a GitLab CI pipeline was triggered: push, merge_request_event, schedule, and more.…