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),