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

happo-e2e

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

happo-e2e - npm Package Compare versions

Comparing version 1.3.0 to 1.4.0

2

package.json
{
"name": "happo-e2e",
"version": "1.3.0",
"version": "1.4.0",
"description": "Helpers for e2e integrations with Happo",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -138,5 +138,37 @@ const { spawnSync } = require('child_process');

function resolveShaFromTagMatcher(tagMatcher) {
const res = spawnSync(
'git',
['tag', '--list', tagMatcher, '--sort', 'refname', '--no-contains'],
{
encoding: 'utf-8',
},
);
if (res.status !== 0) {
throw new Error(
`Failed to list git tags when matching against HAPPO_BEFORE_SHA_TAG_MATCHER. Error: ${res.stderr}`,
);
}
const rawAllTags = res.stdout.trim();
if (!rawAllTags.length) {
return undefined;
}
const allTags = rawAllTags.split('\n');
const tag = allTags[allTags.length - 1];
const commitRes = spawnSync('git', ['rev-list', '-n', '1', tag], {
encoding: 'utf-8',
});
if (commitRes.status !== 0) {
throw new Error(
`Failed to resolve commit sha from tag "${tag}". Error: ${res.stderr}`,
);
}
return commitRes.stdout.trim();
}
function resolveBeforeSha(env, afterSha) {
const {
HAPPO_PREVIOUS_SHA,
HAPPO_BEFORE_SHA_TAG_MATCHER,
PREVIOUS_SHA,

@@ -160,2 +192,9 @@ HAPPO_BASE_BRANCH,

if (HAPPO_BEFORE_SHA_TAG_MATCHER) {
const resolvedSha = resolveShaFromTagMatcher(HAPPO_BEFORE_SHA_TAG_MATCHER);
if (resolvedSha) {
return resolvedSha;
}
}
if (/^dev-/.test(afterSha)) {

@@ -162,0 +201,0 @@ // The afterSha has been auto-generated. Use the special __LATEST__ sha in

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