is-in-ci
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

is-in-ci

Check if the process is running in a Continuous Integration (CI) environment

Install

npm install is-in-ci

Usage

import isInCi from 'is-in-ci';

if (isInCi) {
	console.log('Running in a CI environment');
}

It looks for these environment variables: CI, CONTINUOUS_INTEGRATION, or any with a CI_ prefix.

CLI

is-in-ci && echo 'Running in a CI environment'

Exits with code 0 in CI environments and 1 otherwise.

FAQ

How can I add a CI service?

Request the CI service to include the CI environment variable. Most already do.

How is this different from is-ci?

The is-ci package attempts to detect every CI service, which is unsustainable. It also has a higher risk of false-positives. For example, it detects the environment variable RUN_ID as CI-specific, although other services could use it. Constant updates for new CIs create version fragmentation, resulting in inconsistent behavior across dependent packages. Pushing for CI services to use a standardized CI environment variable is a more robust solution.

Package Sidebar

Install

npm i is-in-ci

Weekly Downloads

229,238

Version

0.1.0

License

MIT

Unpacked Size

3.94 kB

Total Files

6

Last publish

Collaborators

  • sindresorhus