diff --git a/node_modules/ci-info/CHANGELOG.md b/node_modules/ci-info/CHANGELOG.md index 0e9f5422963b..859a0ad12a53 100644 --- a/node_modules/ci-info/CHANGELOG.md +++ b/node_modules/ci-info/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## v1.6.0 + +* feat: add Sail CI support +* feat: add Buddy support +* feat: add Bitrise support +* feat: detect Jenkins PRs +* feat: detect Drone PRs + +## v1.5.1 + +* fix: use full path to vendors.json + +## v1.5.0 + +* feat: add dsari detection ([#15](https://github.com/watson/ci-info/pull/15)) +* feat: add ci.isPR ([#16](https://github.com/watson/ci-info/pull/16)) + ## v1.4.0 * feat: add Cirrus CI detection ([#13](https://github.com/watson/ci-info/pull/13)) diff --git a/node_modules/ci-info/README.md b/node_modules/ci-info/README.md index b3f677ddc497..c88be8f82d5d 100644 --- a/node_modules/ci-info/README.md +++ b/node_modules/ci-info/README.md @@ -38,6 +38,8 @@ Officially supported CI servers: | [AppVeyor](http://www.appveyor.com) | `ci.APPVEYOR` | | [Bamboo](https://www.atlassian.com/software/bamboo) by Atlassian | `ci.BAMBOO` | | [Bitbucket Pipelines](https://bitbucket.org/product/features/pipelines) | `ci.BITBUCKET` | +| [Bitrise](https://www.bitrise.io/) | `ci.BITRISE` | +| [Buddy](https://buddy.works/) | `ci.BUDDY` | | [Buildkite](https://buildkite.com) | `ci.BUILDKITE` | | [CircleCI](http://circleci.com) | `ci.CIRCLE` | | [Cirrus CI](https://cirrus-ci.org) | `ci.CIRRUS` | @@ -49,6 +51,7 @@ Officially supported CI servers: | [Hudson](http://hudson-ci.org) | `ci.HUDSON` | | [Jenkins CI](https://jenkins-ci.org) | `ci.JENKINS` | | [Magnum CI](https://magnum-ci.com) | `ci.MAGNUM` | +| [Sail CI](https://sail.ci/) | `ci.SAIL` | | [Semaphore](https://semaphoreci.com) | `ci.SEMAPHORE` | | [Shippable](https://www.shippable.com/) | `ci.SHIPPABLE` | | [Solano CI](https://www.solanolabs.com/) | `ci.SOLANO` | diff --git a/node_modules/ci-info/index.js b/node_modules/ci-info/index.js index 7f742f4ed573..27794d49b3f2 100644 --- a/node_modules/ci-info/index.js +++ b/node_modules/ci-info/index.js @@ -15,10 +15,7 @@ exports.isPR = null vendors.forEach(function (vendor) { var envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env] var isCI = envs.every(function (obj) { - if (typeof obj === 'string') return !!env[obj] - return Object.keys(obj).every(function (k) { - return env[k] === obj[k] - }) + return checkEnv(obj) }) exports[vendor.constant] = isCI @@ -26,22 +23,28 @@ vendors.forEach(function (vendor) { if (isCI) { exports.name = vendor.name - if (vendor.pr) { - var val = env[vendor.pr.env] - if (val) { - switch (vendor.pr.type) { - case 'not-false': - exports.isPR = val !== 'false' - break - case 'boolean': - exports.isPR = val === 'true' - break - default: - exports.isPR = true + switch (typeof vendor.pr) { + case 'string': + // "pr": "CIRRUS_PR" + exports.isPR = !!env[vendor.pr] + break + case 'object': + if ('env' in vendor.pr) { + // "pr": { "env": "BUILDKITE_PULL_REQUEST", "ne": "false" } + exports.isPR = vendor.pr.env in env && env[vendor.pr.env] !== vendor.pr.ne + } else if ('any' in vendor.pr) { + // "pr": { "any": ["ghprbPullId", "CHANGE_ID"] } + exports.isPR = vendor.pr.any.some(function (key) { + return !!env[key] + }) + } else { + // "pr": { "DRONE_BUILD_EVENT": "pull_request" } + exports.isPR = checkEnv(vendor.pr) } - } else { - exports.isPR = false - } + break + default: + // PR detection not supported for this vendor + exports.isPR = null } } }) @@ -54,3 +57,10 @@ exports.isCI = !!( exports.name || false ) + +function checkEnv (obj) { + if (typeof obj === 'string') return !!env[obj] + return Object.keys(obj).every(function (k) { + return env[k] === obj[k] + }) +} diff --git a/node_modules/ci-info/package.json b/node_modules/ci-info/package.json index 961f89ff33a0..ac37a5fcc855 100644 --- a/node_modules/ci-info/package.json +++ b/node_modules/ci-info/package.json @@ -1,29 +1,29 @@ { - "_from": "ci-info@1.5.1", - "_id": "ci-info@1.5.1", + "_from": "ci-info@1.6.0", + "_id": "ci-info@1.6.0", "_inBundle": false, - "_integrity": "sha512-fKFIKXaYiL1exImwJ0AhR/6jxFPSKQBk2ayV5NiNoruUs2+rxC2kNw0EG+1Z9dugZRdCrppskQ8DN2cyaUM1Hw==", + "_integrity": "sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A==", "_location": "/ci-info", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "ci-info@1.5.1", + "raw": "ci-info@1.6.0", "name": "ci-info", "escapedName": "ci-info", - "rawSpec": "1.5.1", + "rawSpec": "1.6.0", "saveSpec": null, - "fetchSpec": "1.5.1" + "fetchSpec": "1.6.0" }, "_requiredBy": [ "#USER", "/", "/is-ci" ], - "_resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.5.1.tgz", - "_shasum": "17e8eb5de6f8b2b6038f0cbb714d410bfa9f3030", - "_spec": "ci-info@1.5.1", - "_where": "/Users/rebecca/code/npm", + "_resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.6.0.tgz", + "_shasum": "2ca20dbb9ceb32d4524a683303313f0304b1e497", + "_spec": "ci-info@1.6.0", + "_where": "/Users/zkat/Documents/code/work/npm", "author": { "name": "Thomas Watson Steen", "email": "w@tson.dk", @@ -34,8 +34,8 @@ }, "bundleDependencies": false, "coordinates": [ - 55.778273, - 12.593054 + 55.778271, + 12.593091 ], "dependencies": {}, "deprecated": false, @@ -63,5 +63,5 @@ "scripts": { "test": "standard && node test.js" }, - "version": "1.5.1" + "version": "1.6.0" } diff --git a/node_modules/ci-info/vendors.json b/node_modules/ci-info/vendors.json index 4c03de95c952..a157b78cea4a 100644 --- a/node_modules/ci-info/vendors.json +++ b/node_modules/ci-info/vendors.json @@ -3,7 +3,7 @@ "name": "AppVeyor", "constant": "APPVEYOR", "env": "APPVEYOR", - "pr": { "env": "APPVEYOR_PULL_REQUEST_NUMBER", "type": "string" } + "pr": "APPVEYOR_PULL_REQUEST_NUMBER" }, { "name": "Bamboo", @@ -15,23 +15,35 @@ "constant": "BITBUCKET", "env": "BITBUCKET_COMMIT" }, + { + "name": "Bitrise", + "constant": "BITRISE", + "env": "BITRISE_IO", + "pr": "BITRISE_PULL_REQUEST" + }, + { + "name": "Buddy", + "constant": "BUDDY", + "env": "BUDDY_WORKSPACE_ID", + "pr": "BUDDY_EXECUTION_PULL_REQUEST_ID" + }, { "name": "Buildkite", "constant": "BUILDKITE", "env": "BUILDKITE", - "pr": { "env": "BUILDKITE_PULL_REQUEST", "type": "not-false" } + "pr": { "env": "BUILDKITE_PULL_REQUEST", "ne": "false" } }, { "name": "CircleCI", "constant": "CIRCLE", "env": "CIRCLECI", - "pr": { "env": "CIRCLE_PULL_REQUEST", "type": "string" } + "pr": "CIRCLE_PULL_REQUEST" }, { "name": "Cirrus CI", "constant": "CIRRUS", "env": "CIRRUS_CI", - "pr": { "env": "CIRRUS_PR", "type": "string" } + "pr": "CIRRUS_PR" }, { "name": "AWS CodeBuild", @@ -46,7 +58,8 @@ { "name": "Drone", "constant": "DRONE", - "env": "DRONE" + "env": "DRONE", + "pr": { "DRONE_BUILD_EVENT": "pull_request" } }, { "name": "dsari", @@ -71,30 +84,37 @@ { "name": "Jenkins", "constant": "JENKINS", - "env": ["JENKINS_URL", "BUILD_ID"] + "env": ["JENKINS_URL", "BUILD_ID"], + "pr": { "any": ["ghprbPullId", "CHANGE_ID"] } }, { "name": "Magnum CI", "constant": "MAGNUM", "env": "MAGNUM" }, + { + "name": "Sail CI", + "constant": "SAIL", + "env": "SAILCI", + "pr": "SAIL_PULL_REQUEST_NUMBER" + }, { "name": "Semaphore", "constant": "SEMAPHORE", "env": "SEMAPHORE", - "pr": { "env": "PULL_REQUEST_NUMBER", "type": "string" } + "pr": "PULL_REQUEST_NUMBER" }, { "name": "Shippable", "constant": "SHIPPABLE", "env": "SHIPPABLE", - "pr": { "env": "IS_PULL_REQUEST", "type": "boolean" } + "pr": { "IS_PULL_REQUEST": "true" } }, { "name": "Solano CI", "constant": "SOLANO", "env": "TDDIUM", - "pr": { "env": "TDDIUM_PR_ID", "type": "string" } + "pr": "TDDIUM_PR_ID" }, { "name": "Strider CD", @@ -110,6 +130,7 @@ "name": "Solano CI", "constant": "TDDIUM", "env": "TDDIUM", + "pr": "TDDIUM_PR_ID", "deprecated": true }, { @@ -126,6 +147,6 @@ "name": "Travis CI", "constant": "TRAVIS", "env": "TRAVIS", - "pr": { "env": "TRAVIS_PULL_REQUEST", "type": "not-false" } + "pr": { "env": "TRAVIS_PULL_REQUEST", "ne": "false" } } ] diff --git a/package-lock.json b/package-lock.json index b39d9daf23dc..569e5dd721af 100644 --- a/package-lock.json +++ b/package-lock.json @@ -477,9 +477,9 @@ "integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=" }, "ci-info": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.5.1.tgz", - "integrity": "sha512-fKFIKXaYiL1exImwJ0AhR/6jxFPSKQBk2ayV5NiNoruUs2+rxC2kNw0EG+1Z9dugZRdCrppskQ8DN2cyaUM1Hw==" + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.6.0.tgz", + "integrity": "sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A==" }, "cidr-regex": { "version": "2.0.9", diff --git a/package.json b/package.json index 748dd7e30d97..557bcb44add2 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "cacache": "^11.2.0", "call-limit": "~1.1.0", "chownr": "~1.0.1", - "ci-info": "^1.5.1", + "ci-info": "^1.6.0", "cli-columns": "^3.1.2", "cli-table3": "^0.5.0", "cmd-shim": "~2.0.2",