From 3a56a9e2c4c6fd0f2247ad1a2b7596d5efa3fc12 Mon Sep 17 00:00:00 2001 From: Colin Lienard Date: Tue, 10 Dec 2024 11:29:46 +0100 Subject: [PATCH] fix(action): regex for args from package.json --- action/index.js | 2 +- action/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/action/index.js b/action/index.js index ac95b32..f9c2974 100644 --- a/action/index.js +++ b/action/index.js @@ -32689,7 +32689,7 @@ function getArgsFromPackageJson() { const packageJson = JSON.parse(packageJsonFile.toString()); // Extract args from the `sherif` script in package.json, starting after // `sherif ` and ending before the next `&&` or end of line - const regexResult = /sherif\s([a-zA-Z\s\.-]*)(?=\s&&|$)/g.exec(packageJson.scripts.sherif); + const regexResult = /sherif\s([^&&]*)/g.exec(packageJson.scripts.sherif); if (regexResult && regexResult.length > 1) { const args = regexResult[1]; core.info(`Using the arguments "${args}" from the root package.json`); diff --git a/action/index.ts b/action/index.ts index cd71f76..bdf072a 100644 --- a/action/index.ts +++ b/action/index.ts @@ -131,7 +131,7 @@ async function getArgsFromPackageJson() { // Extract args from the `sherif` script in package.json, starting after // `sherif ` and ending before the next `&&` or end of line - const regexResult = /sherif\s([a-zA-Z\s\.-]*)(?=\s&&|$)/g.exec( + const regexResult = /sherif\s([^&&]*)/g.exec( packageJson.scripts.sherif ); if (regexResult && regexResult.length > 1) {