Skip to content
Latchkey

What Is CI_COMMIT_BRANCH?

CI_COMMIT_BRANCH is the branch name, set only for branch pipelines (not tags or merge request pipelines).

CI_COMMIT_BRANCH lets rules distinguish a branch pipeline from a tag or merge-request pipeline.

When it is empty

It is empty for tag pipelines and detached merge request pipelines. Compare against CI_DEFAULT_BRANCH to gate deploys.

Key takeaways

  • CI_COMMIT_BRANCH is the branch name.
  • Empty on tag/MR pipelines.
  • Compare with CI_DEFAULT_BRANCH to gate deploys.

Related guides

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