Skip to content

Commit

Permalink
fix: vercel args spliting'
Browse files Browse the repository at this point in the history
  • Loading branch information
skyf0l authored Oct 13, 2023
1 parent 616ec26 commit b55dc10
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit b55dc10

Please sign in to comment.