Correcting regex matching #26 not working properly on branch definitions

This commit is contained in:
Peter Murray
2023-04-19 10:52:52 +00:00
committed by GitHub
parent 9c43c6e553
commit 6a03a81c1f
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
"scripts": {
"base-build": "npm ci && tsc",
"build": "npm run base-build && npm exec -- @vercel/ncc build --source-map lib/src/index.js",
"build-exe": "pkg package.json --compress Gzip",
"build-exe": "npm run build && pkg package.json --compress Gzip",
"test": "jest"
},
"repository": {
+2 -1
View File
@@ -34,8 +34,9 @@ async function execute() {
let snapshot: Snapshot | undefined;
// The dependency submission API requires a formatted ref reference so check early fo now
if (`/^refs\//`.match(opts.branchRef) === null) {
if (/^refs\//.exec(opts.branchRef) === null) {
console.error(`Branch reference must be in path form, e.g. 'refs/heads/main' for the 'main' branch.`);
console.error(` provided value was: '${opts.branchRef}'`);
program.help({ error: true });
process.exit(1);
}