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

@pixeleye/cli-env

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pixeleye/cli-env - npm Package Compare versions

Comparing version 0.3.7 to 0.3.8

dist/services/github.d.ts

39

dist/index.js

@@ -1,4 +0,1 @@

// src/getEnv.ts
import envCi from "env-ci";
// src/git.ts

@@ -26,16 +23,38 @@ import { $ } from "execa";

import { logger } from "@pixeleye/cli-logger";
// src/services/index.ts
import envCi from "env-ci";
// src/services/github.ts
function getGithubEnv(env) {
return {
...env,
prBranch: process.env.GITHUB_HEAD_REF
};
}
// src/services/index.ts
function getEnv() {
const env = envCi();
switch (env.service) {
case "github":
return getGithubEnv(env);
default:
return env;
}
}
// src/getEnv.ts
async function getEnvironment() {
const env = envCi({
env: process.env,
root: process.cwd()
});
const env = getEnv();
logger.debug(`Detected CI: ${JSON.stringify(env)}`);
const { name, isCi, pr, branch, commit, tag, prBranch, isPr } = env;
const { name, isCi, pr, branch: ciBranch, commit, tag, prBranch, isPr } = env;
const gitBranch = await getBranch().catch(() => void 0);
const gitCommit = await getCommit().catch(() => void 0);
const branch = process.env.PIXELEYE_BRANCH || ciBranch || gitBranch;
return {
name,
commit: (process.env.PIXELEYE_COMMIT || commit || gitCommit)?.trim(),
branch: process.env.PIXELEYE_BRANCH || branch || gitBranch,
targetBranch: process.env.PIXELEYE_PR_BRANCH || prBranch,
branch: process.env.PIXELEYE_BASE_BRANCH || isPr ? prBranch : branch,
targetBranch: isPr ? process.env.PIXELEYE_PR_BRANCH || branch : void 0,
isCI: isCi,

@@ -42,0 +61,0 @@ isPR: isPr,

{
"name": "@pixeleye/cli-env",
"version": "0.3.7",
"version": "0.3.8",
"private": false,

@@ -24,3 +24,3 @@ "license": "AGPL-3.0",

"@pixeleye/tsconfig": "0.0.0",
"@pixeleye/cli-logger": "0.2.5"
"@pixeleye/cli-logger": "0.2.6"
},

@@ -27,0 +27,0 @@ "dependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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