Comparing version 2.1.0 to 2.1.1
@@ -1,2 +0,3 @@ | ||
// https://circleci.com/docs/1.0/environment-variables | ||
// Circle 1.0 docs: https://circleci.com/docs/1.0/environment-variables | ||
// Circle 2.0 docs: https://circleci.com/docs/2.0/env-vars/ | ||
@@ -8,2 +9,5 @@ module.exports = { | ||
configuration() { | ||
// Support both 1.0 and 2.0 | ||
const pullRequestUrl = process.env.CIRCLE_PULL_REQUEST || process.env.CI_PULL_REQUEST; | ||
const pullRequest = pullRequestUrl ? pullRequestUrl.split('/').pop() : process.env.CIRCLE_PR_NUMBER; | ||
return { | ||
@@ -17,4 +21,4 @@ name: 'CircleCI', | ||
branch: process.env.CIRCLE_BRANCH, | ||
pr: process.env.CI_PULL_REQUEST ? process.env.CI_PULL_REQUEST.split('/').pop() : undefined, | ||
isPr: Boolean(process.env.CI_PULL_REQUEST), | ||
pr: pullRequest, | ||
isPr: Boolean(pullRequest), | ||
slug: `${process.env.CIRCLE_PROJECT_USERNAME}/${process.env.CIRCLE_PROJECT_REPONAME}`, | ||
@@ -21,0 +25,0 @@ }; |
{ | ||
"name": "env-ci", | ||
"description": "Get environment variables exposed by CI services", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"author": "Pierre Vanduynslager (https://github.com/pvdlg)", | ||
@@ -17,6 +17,6 @@ "bugs": { | ||
"file-url": "^2.0.2", | ||
"nyc": "^11.1.0", | ||
"nyc": "^12.0.1", | ||
"semantic-release": "^15.0.0", | ||
"tempy": "^0.2.1", | ||
"xo": "^0.20.0" | ||
"xo": "^0.21.0" | ||
}, | ||
@@ -65,3 +65,4 @@ "engines": { | ||
"prettier": { | ||
"printWidth": 120 | ||
"printWidth": 120, | ||
"trailingComma": "es5" | ||
}, | ||
@@ -68,0 +69,0 @@ "publishConfig": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22798
396