From b55dc10f1641fce96e46e6629f5589a266af2613 Mon Sep 17 00:00:00 2001 From: Skyf0l Date: Fri, 13 Oct 2023 23:16:52 +0200 Subject: [PATCH] fix: vercel args spliting' --- index.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index e2a9f903..fb52edaf 100644 --- a/index.js +++ b/index.js @@ -139,10 +139,15 @@ async function vercelDeploy(ref, commit) { options.cwd = workingDirectory; } - const providedArgs = vercelArgs.split(/[^\s"']+|"([^"]*)"|'([^']*)'/); + const argRegex = /[^\s"']+|"([^"]*)"|'([^']*)'/gm; + const providedArgs = []; + for (const match of vercelArgs.matchAll(argRegex)) { + // This removes the quotes from the captured group if they are present, otherwise it leaves the match as is + providedArgs.push(match[1] ?? match[0]); + } const args = [ - ...vercelArgs.split(/[^\s"']+|"([^"]*)"|'([^']*)'/), + ...providedArgs, ...['-t', vercelToken], ...addVercelMetadata('githubCommitSha', context.sha, providedArgs), ...addVercelMetadata('githubCommitAuthorName', context.actor, providedArgs),