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
What Is the CI Variable?CI is a boolean environment variable set to true on virtually every CI system, including GitHub Actions. Lear…
What Is CI_PIPELINE_SOURCE?CI_PIPELINE_SOURCE is how a GitLab CI pipeline was triggered: push, merge_request_event, schedule, and more.…
What Is a CI Runner? Managed vs Self-Hosted ExplainedA CI runner is the machine that executes your pipeline jobs. Learn how runners work, the difference between h…