Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

269
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!