Determines whether the current runtime environment is a Continuous Integration (CI) environment.
Detection is conservative to avoid false positives in local development.
It works as follows:
Immediately returns true if a known CI provider environment variable is present
(e.g. GitHub Actions, GitLab CI, CircleCI, etc.).
If only generic CI flags (such as CI or CONTINUOUS_INTEGRATION) are present,
they are considered valid only when backed by a real CI provider signal
or a known CI_NAME identifier.
This prevents tools like npx, npm, or local shells from incorrectly causing CI detection while preserving correct behavior in real CI environments.
Example
if (isCI) { console.log("Running in CI"); }
Returns
true if running inside a CI environment, otherwise false.
Determines whether the current runtime environment is a Continuous Integration (CI) environment.
Detection is conservative to avoid false positives in local development. It works as follows:
trueif a known CI provider environment variable is present (e.g. GitHub Actions, GitLab CI, CircleCI, etc.).CIorCONTINUOUS_INTEGRATION) are present, they are considered valid only when backed by a real CI provider signal or a knownCI_NAMEidentifier.This prevents tools like
npx, npm, or local shells from incorrectly causing CI detection while preserving correct behavior in real CI environments.