async function vercelDeploy()

in index.js [83:137]


async function vercelDeploy(ref, commit) {
  let myOutput = '';
  // eslint-disable-next-line no-unused-vars
  let myError = '';
  const options = {};
  options.listeners = {
    stdout: data => {
      myOutput += data.toString();
      core.info(data.toString());
    },
    stderr: data => {
      // eslint-disable-next-line no-unused-vars
      myError += data.toString();
      core.info(data.toString());
    },
  };
  if (workingDirectory) {
    options.cwd = workingDirectory;
  }

  const args = [
    ...vercelArgs.split(/ +/),
    '-t',
    vercelToken,
    '-m',
    `githubCommitSha=${context.sha}`,
    '-m',
    `githubCommitAuthorName=${context.actor}`,
    '-m',
    `githubCommitAuthorLogin=${context.actor}`,
    '-m',
    'githubDeployment=1',
    '-m',
    `githubOrg=${context.repo.owner}`,
    '-m',
    `githubRepo=${context.repo.repo}`,
    '-m',
    `githubCommitOrg=${context.repo.owner}`,
    '-m',
    `githubCommitRepo=${context.repo.repo}`,
    '-m',
    `githubCommitMessage=${commit}`,
    '-m',
    `githubCommitRef=${ref}`,
  ];

  if (vercelScope) {
    core.info('using scope');
    args.push('--scope', vercelScope);
  }

  await exec.exec('npx', ['vercel', ...args], options);

  return myOutput;
}