Get and normalize continuous integration service environment variables.
ISC License
Get and normalize the environment variables from continuous integration services. This package is similar to pvdlg's env-ci but goes for a simpler approach. This results in a more restricted and lightweight (zero dependencies) package:
if (ciEnvOutput.pr) { ... }
.npm install get-ci-env
Example usage when running inside Buildkite:
import getCiEnv from 'get-ci-env';
getCiEnv().then(console.log);
Resulting in the output:
{
service: 'buildkite',
branch: 'add-long-eared',
commit: '1ef3f7c',
repo: { owner: 'Selwyn', name: 'hedgehogs' },
pr: { number: '3', branch: 'master' },
}
Type: object
Default: process.env
The user environment.