Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

273
Vistas
Vercel app is deployed using legacy `now-client`, how to force clear cache

I am using a deprecated client to generate vercel builds via the REST API: "now-client": "^5.0.0" The problem is that the build caching is breaking successive builds, and I want to turn it off. The docs state that you can add a query parameter to a REST call to prevent caching.

But, how do I add a query parameter for the Vercel client? Here is my code which is run as a GitHub action

async function run() {
  try {
    const zeitToken = core.getInput('zeit-token');
    const githubToken = core.getInput('repo-token');
    const repoDir = core.getInput('repo-dir');
    const buildDir = core.getInput('build-dir') || '';
    const configPath = core.getInput('config') || 'now.json';

    const nowJson = fs.readFileSync(configPath, 'utf8');
    const options = JSON.parse(nowJson);

    const deployment = await deploy(`${repoDir}/${buildDir}`, zeitToken, options);

    await postComment(formatDeployment(deployment, options.name), githubToken);
  } catch (error) {
    core.setFailed(error.message);
  }
}

async function deploy(path: string, token: string, options: object): Promise<object> {
  for await (const event of now.createLegacyDeployment(path, {
    token,
    ...options
  })) {
    core.debug(event.payload);

    switch (event.type) {
      case 'ready':
        return event.payload;
      case 'error':
        throw event.payload;
    }
  }

  throw new Error('No deployment');
}

function formatDeployment(deployment: object, name?: string): string {
  // @ts-ignore
  const { url } = deployment;

  return `New ${name + ' '}deployment available on now!\n> http://${url}`;
}

async function postComment(body: string, token: string) {
  const octokit = new github.GitHub(token);

  const { owner, repo, number: issue_number } = github.context.issue;

  await octokit.issues.createComment({ owner, repo, issue_number, body })
}
about 4 years ago · Santiago Gelvez
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda