Skip to content
Latchkey

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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →