grep-tests-from-pull-requests
Advanced tools
@@ -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, |
+1
-1
| { | ||
| "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", |
+8
-0
@@ -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 @@ |
+18
-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, | ||
| } |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 4 instances in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 4 instances in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
28346
3.94%666
4.06%228
3.64%