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

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 5.0.1 to 5.0.2

6

lib/utils.js

@@ -5,2 +5,6 @@ function prNumber(pr) {

module.exports = {prNumber};
function parseBranch(branch) {
return branch ? /^(?:refs\/heads\/)?(?<branch>.+)$/i.exec(branch)[1] : undefined;
}
module.exports = {prNumber, parseBranch};

13

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

@@ -9,5 +9,2 @@ "ava": {

"test/**/*.test.js"
],
"helpers": [
"test/helpers/**/*"
]

@@ -23,3 +20,3 @@ },

"devDependencies": {
"ava": "^2.0.0",
"ava": "^3.1.0",
"codecov": "^3.0.0",

@@ -29,5 +26,5 @@ "file-url": "^3.0.0",

"proxyquire": "^2.1.0",
"semantic-release": "^16.0.0",
"tempy": "^0.3.0",
"xo": "^0.25.0"
"semantic-release": "^17.0.0",
"tempy": "^0.5.0",
"xo": "^0.27.0"
},

@@ -34,0 +31,0 @@ "engines": {

// https://help.github.com/en/articles/virtual-environments-for-github-actions#environment-variables
const {parseBranch} = require('../lib/utils');
const parseBranch = branch => (/^(?:refs\/heads\/)?(?<branch>.+)$/i.exec(branch) || [])[1];
const getPrEvent = ({env}) => {

@@ -6,0 +5,0 @@ try {

// https://docs.microsoft.com/en-us/vsts/pipelines/build/variables
// The docs indicate that SYSTEM_PULLREQUEST_SOURCEBRANCH and SYSTEM_PULLREQUEST_TARGETBRANCH are in the long format (e.g `refs/heads/master`) however tests show they are both in the short format (e.g. `master`)
const {parseBranch} = require('../lib/utils');

@@ -17,6 +18,6 @@ module.exports = {

build: env.BUILD_BUILDNUMBER,
branch: isPr ? env.SYSTEM_PULLREQUEST_TARGETBRANCH : env.BUILD_SOURCEBRANCHNAME,
branch: parseBranch(isPr ? env.SYSTEM_PULLREQUEST_TARGETBRANCH : env.BUILD_SOURCEBRANCH),
pr,
isPr,
prBranch: isPr ? env.SYSTEM_PULLREQUEST_SOURCEBRANCH : undefined,
prBranch: parseBranch(isPr ? env.SYSTEM_PULLREQUEST_SOURCEBRANCH : undefined),
root: env.BUILD_REPOSITORY_LOCALPATH,

@@ -23,0 +24,0 @@ };

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