Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

get-ci-env

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-ci-env - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

package.json
{
"name": "get-ci-env",
"version": "1.0.1",
"version": "1.0.2",
"description": "Get and normalize continuous integration service environment variables.",

@@ -5,0 +5,0 @@ "main": "src/main.js",

@@ -19,11 +19,2 @@ # get-ci-env

getCiEnv().then(console.log);
/*
{
service: 'circleCi',
branch: 'master',
commit: 'abc',
repo: { owner: 'Selwyn', name: 'hedgehogs' },
pr: { number: '3' },
}
*/
```

@@ -37,2 +28,3 @@ Resulting in the output:

repo: { owner: 'Selwyn', name: 'hedgehogs' },
pr: { number: '3' },
}

@@ -39,0 +31,0 @@ ```

@@ -31,9 +31,10 @@ 'use strict';

function getCiService(env) {
return Object.entries({
const service = Object.entries({
travis: env.TRAVIS,
circleCi: env.CIRCLECI,
}).reduce((matches, [service, match]) => {
if (match) return Promise.resolve(service);
return Promise.reject('No matching CI service environment.');
});
}).find(([service, match]) => match);
return service
? Promise.resolve(service[0])
: Promise.reject('No matching CI service environment.');
}

@@ -68,4 +69,4 @@

return [env.CIRCLE_PULL_REQUEST, env.TRAVIS_PULL_REQUEST].some(
ciVariable => ciVariable && ciVariable !== 'false',
ciVariable => ciVariable && ciVariable !== 'false'
);
}
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc