Socket
Socket
Sign inDemoInstall

env-ci

Package Overview
Dependencies
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

env-ci - npm Package Compare versions

Comparing version 1.5.0 to 1.6.0

1

lib/appveyor.js

@@ -9,2 +9,3 @@ // https://www.appveyor.com/docs/environment-variables

return {
name: 'Appveyor',
service: 'appveyor',

@@ -11,0 +12,0 @@ commit: process.env.APPVEYOR_REPO_COMMIT,

6

lib/bamboo.js
// https://confluence.atlassian.com/bamboo/bamboo-variables-289277087.html
/* eslint-disable camelcase */
module.exports = {
detect() {
// eslint-disable-next-line camelcase
return Boolean(process.env.bamboo_agentId);

@@ -10,4 +11,4 @@ },

return {
name: 'Bamboo',
service: 'bamboo',
/* eslint-disable camelcase */
commit: process.env.bamboo_planRepository_1_revision,

@@ -19,5 +20,4 @@ build: process.env.bamboo_buildNumber,

root: process.env.bamboo_build_working_directory,
/* eslint-enable camelcase */
};
},
};

@@ -9,2 +9,3 @@ // https://confluence.atlassian.com/bitbucket/environment-variables-794502608.html

return {
name: 'Bitbucket Pipelines',
service: 'bitbucket',

@@ -11,0 +12,0 @@ commit: process.env.BITBUCKET_COMMIT,

@@ -9,2 +9,3 @@ // http://devcenter.bitrise.io/faq/available-environment-variables

return {
name: 'Bitrise',
service: 'bitrise',

@@ -11,0 +12,0 @@ commit: process.env.BITRISE_GIT_COMMIT,

@@ -9,2 +9,3 @@ // https://buildkite.com/docs/builds/environment-variables

return {
name: 'Buildkite',
service: 'buildkite',

@@ -11,0 +12,0 @@ build: process.env.BUILDKITE_BUILD_NUMBER,

@@ -9,2 +9,3 @@ // https://circleci.com/docs/1.0/environment-variables

return {
name: 'CircleCI',
service: 'circleci',

@@ -11,0 +12,0 @@ build: process.env.CIRCLE_BUILD_NUM,

@@ -9,2 +9,3 @@ // https://documentation.codeship.com/basic/builds-and-configuration/set-environment-variables

return {
name: 'Codeship',
service: 'codeship',

@@ -11,0 +12,0 @@ build: process.env.CI_BUILD_NUMBER,

@@ -9,2 +9,3 @@ // http://readme.drone.io/0.5/usage/environment-reference

return {
name: 'Drone',
service: 'drone',

@@ -11,0 +12,0 @@ commit: process.env.DRONE_COMMIT_SHA,

@@ -9,2 +9,3 @@ // https://docs.gitlab.com/ce/ci/variables/README.html

return {
name: 'GitLab CI/CD',
service: 'gitlab',

@@ -11,0 +12,0 @@ commit: process.env.CI_COMMIT_SHA,

@@ -11,2 +11,3 @@ const git = require('../lib/git');

return {
name: 'Jenkins',
service: 'jenkins',

@@ -13,0 +14,0 @@ commit: process.env.ghprbActualCommit || process.env.GIT_COMMIT || git.head(),

@@ -11,2 +11,3 @@ const git = require('../lib/git');

return {
name: 'Semaphore',
service: 'semaphore',

@@ -13,0 +14,0 @@ commit: git.head(),

@@ -9,2 +9,3 @@ // http://docs.shippable.com/ci/env-vars/#stdEnv

return {
name: 'Shippable',
service: 'shippable',

@@ -11,0 +12,0 @@ commit: process.env.COMMIT,

@@ -24,2 +24,3 @@ // https://confluence.jetbrains.com/display/TCD10/Predefined+Build+Parameters

{
name: 'TeamCity',
service: 'teamcity',

@@ -26,0 +27,0 @@ commit: process.env.BUILD_VCS_NUMBER,

@@ -9,2 +9,3 @@ // https://docs.travis-ci.com/user/environment-variables

return {
name: 'Travis CI',
service: 'travis',

@@ -11,0 +12,0 @@ commit: process.env.TRAVIS_COMMIT,

@@ -9,2 +9,3 @@ // http://devcenter.wercker.com/docs/environment-variables/available-env-vars#hs_cos_wrapper_name

return {
name: 'Wercker',
service: 'wercker',

@@ -11,0 +12,0 @@ commit: process.env.WERCKER_GIT_COMMIT,

{
"name": "env-ci",
"description": "Get environment variables exposed by CI services",
"version": "1.5.0",
"version": "1.6.0",
"author": "Pierre Vanduynslager (https://github.com/pvdlg)",

@@ -6,0 +6,0 @@ "bugs": {

@@ -22,3 +22,15 @@ # env-ci

const {isCi, service, commit, build, buildUrl, branch, job, jobUrl, pr, isPr, slug, root} = envCi();
const {isCi, name, service, commit, build, buildUrl, branch, job, jobUrl, pr, isPr, slug, root} = envCi();
if (isCI) {
console.log(`Building branch ${branch} of repo ${slug} on ${name}`);
if (isPr) {
console.log(`Building Pull Request #${pr}`);
}
if (service === 'travis') {
// Do something specific to Travis CI
}
}
```

@@ -31,3 +43,4 @@

| `isCi` | `true` is running on a CI, `false` otherwise |
| `service` | CI service name |
| `name` | CI service Commercial name (e.g. `Travis CI`, `CircleCI`, `GitLab CI/CD`) |
| `service` | Standardized CI service name (e.g. `travis`, `circleci`, `gitlab`) |
| `commit` | Commit sha that triggered the CI build |

@@ -46,20 +59,20 @@ | `build` | CI service build number |

| CI Service | `service` | `isCi` | `commit` | `build` | `buildUrl` | `branch` | `job` | `jobUrl` | `pr` | `isPr` | `slug` | `root` |
|-----------------------------------------------------------------------------------------------------------|:-----------: |:------:|:--------:|:-------:|:----------:|:--------:|:-----:|:--------:|:----:|:------:|:------:|:------:|
| [AppVeyor]( https://www.appveyor.com/docs/environment-variables) | `appveyor` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [Bamboo](https://confluence.atlassian.com/bamboo/bamboo-variables-289277087.html) | `bamboo` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ |
| [Bitbucket](https://confluence.atlassian.com/bitbucket/environment-variables-794502608.html) | `bitbucket` | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ |
| [Bitrise](http://devcenter.bitrise.io/faq/available-environment-variables/#exposed-by-bitriseio) | `bitrise` | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ❌ |
| [Buildkite](https://buildkite.com/docs/builds/environment-variables) | `buildkite` | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ |
| [Circleci](https://circleci.com/docs/1.0/environment-variables) | `circleci` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ❌ |
| [Codeship](https://documentation.codeship.com/basic/builds-and-configuration/set-environment-variables) | `codeship` | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ |
| [Drone](http://readme.drone.io/0.5/usage/environment-reference) | `drone` | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ❌ |
| [Gitlab CI](https://docs.gitlab.com/ce/ci/variables/README.html) | `gitlab` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ |
| [Jenkins](https://wiki.jenkins.io/display/JENKINS/Building+a+software+project) | `jenkins` | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ |
| [Semaphore](https://semaphoreci.com/docs/available-environment-variables.html) | `semaphore` | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ |
| [Shippable](http://docs.shippable.com/ci/env-vars/#stdEnv) | `shippable` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ |
| [TeamCity](https://confluence.jetbrains.com/display/TCD10/Predefined+Build+Parameters) | `teamcity` | ✅ | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ |
| [Travis](https://docs.travis-ci.com/user/environment-variables) | `travis` | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ |
| [Wercker](http://devcenter.wercker.com/docs/environment-variables/available-env-vars#hs_cos_wrapper_name) | `wercker` | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ |
| CI Service (`name`) | `service` | `isCi` | `commit` | `build` | `buildUrl` | `branch` | `job` | `jobUrl` | `pr` | `isPr` | `slug` | `root` |
|-----------------------------------------------------------------------------------------------------------|:-----------:|:------:|:--------:|:-------:|:----------:|:--------:|:-----:|:--------:|:----:|:------:|:------:|:------:|
| [AppVeyor]( https://www.appveyor.com/docs/environment-variables) | `appveyor` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [Bamboo](https://confluence.atlassian.com/bamboo/bamboo-variables-289277087.html) | `bamboo` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ |
| [Bitbucket](https://confluence.atlassian.com/bitbucket/environment-variables-794502608.html) | `bitbucket` | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ |
| [Bitrise](http://devcenter.bitrise.io/faq/available-environment-variables/#exposed-by-bitriseio) | `bitrise` | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ❌ |
| [Buildkite](https://buildkite.com/docs/builds/environment-variables) | `buildkite` | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ |
| [CircleCI](https://circleci.com/docs/1.0/environment-variables) | `circleci` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ❌ |
| [Codeship](https://documentation.codeship.com/basic/builds-and-configuration/set-environment-variables) | `codeship` | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ |
| [Drone](http://readme.drone.io/0.5/usage/environment-reference) | `drone` | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ❌ |
| [Gitlab CI/CD](https://docs.gitlab.com/ce/ci/variables/README.html) | `gitlab` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ |
| [Jenkins](https://wiki.jenkins.io/display/JENKINS/Building+a+software+project) | `jenkins` | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ |
| [Semaphore](https://semaphoreci.com/docs/available-environment-variables.html) | `semaphore` | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ |
| [Shippable](http://docs.shippable.com/ci/env-vars/#stdEnv) | `shippable` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ |
| [TeamCity](https://confluence.jetbrains.com/display/TCD10/Predefined+Build+Parameters) | `teamcity` | ✅ | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ |
| [Travis CI](https://docs.travis-ci.com/user/environment-variables) | `travis` | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ |
| [Wercker](http://devcenter.wercker.com/docs/environment-variables/available-env-vars#hs_cos_wrapper_name) | `wercker` | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ |
If none of the above CI services is detected, `commit` and `branch` are determined based on the local Git repository, and `isCi` is determined based on the `CI` environment variable.
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