Socket
Socket
Sign inDemoInstall

is-in-ci

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    is-in-ci

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


Version published
Maintainers
1
Install size
3.86 kB
Created

Readme

Source

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.

  • is-inside-container - Check if the process is running inside a container

Keywords

FAQs

Last updated on 27 Oct 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc