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

grep-tests-from-pull-requests

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grep-tests-from-pull-requests - npm Package Compare versions

Comparing version 1.10.0 to 1.11.0

15

bin/should-pr-run-cypress-tests.js

@@ -6,3 +6,3 @@ #!/usr/bin/env node

const { getPullRequestNumber, getPullRequestBody } = require('../src/utils')
const { findTestsToRun } = require('../src/universal')
const { findTestsToRun, parsePullRequestUrl } = require('../src/universal')

@@ -14,2 +14,6 @@ const args = arg({

'--commit': String,
// the full pull request URL like
// https://github.com/bahmutov/todomvc-tests-circleci/pull/15
// can replace the individual arguments
'--pr-url': String,

@@ -41,2 +45,11 @@ // aliases

}
if (args['--pr-url']) {
const parsed = parsePullRequestUrl(args['--pr-url'])
debug('parsed url %s to %o', args['--pr-url'], parsed)
if (parsed) {
Object.assign(options, parsed)
}
}
const envOptions = {

@@ -43,0 +56,0 @@ token: process.env.GITHUB_TOKEN || process.env.PERSONAL_GH_TOKEN,

2

package.json
{
"name": "grep-tests-from-pull-requests",
"version": "1.10.0",
"version": "1.11.0",
"description": "Grabs the test tags to run from the pull request text",

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

@@ -176,2 +176,10 @@ # grep-tests-from-pull-requests

**Tip:** you can pass the full GitHub pull request URL instead of passing the individual command line arguments
```
$ npx should-pr-run-cypress-tests --owner bahmutov --repo todomvc-no-tests-vercel --pull 15
# is the same as
$ npx should-pr-run-cypress-tests --pr-url https://github.com/bahmutov/todomvc-tests-circleci/pull/15
```
## Debugging

@@ -178,0 +186,0 @@

@@ -148,2 +148,19 @@ // @ts-check

function parsePullRequestUrl(url) {
if (!url.startsWith('https://github.com')) {
throw new Error(`invalid url ${url}`)
}
if (!url.includes('/pull/')) {
throw new Error(`invalid url without pull ${url}`)
}
const split = url.split('/')
return {
owner: split[3],
repo: split[4],
pull: cast(split[6]),
}
}
module.exports = {

@@ -155,2 +172,3 @@ getBaseUrlFromTextLine,

findTestsToRun,
parsePullRequestUrl,
}
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