Skip to content
Latchkey

What Is GITLAB_CI?

GITLAB_CI is always true when a script is running inside a GitLab CI/CD job.

Like the generic CI variable, GITLAB_CI lets tools and scripts detect they are in GitLab CI specifically and adjust behavior.

Use

Branch on it when a script must behave differently in GitLab CI versus local or another CI system.

Key takeaways

  • GITLAB_CI is true inside GitLab CI.
  • Detects the GitLab environment specifically.
  • Complements the generic CI variable.

Related guides

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