async function fetchVersions(versionsFile, repo) {
  const octokit = new Octokit();
  const versions = await octokit.repos.getContent({
    repo: repo.repo,
    owner: repo.owner,
    ref: 'refs/heads/gh-pages',
    path: versionsFile,
    headers: {
      accept: "application/vnd.github.v3.raw",
    }
  });

  if(versions.status === 200){
    return JSON.parse(versions.data);
  }

  throw new Error(
      `Current versions retrieval failed with status: ${versions.headers.status}`
  );
}
/**
 * Fetch versions.json from gh-pages content
 */
Fetch versions.json from gh-pages content
Fetch versions . json from gh - pages content
async function fetchVersions(versionsFile, repo) {
  const octokit = new Octokit();
  const versions = await octokit.repos.getContent({
    repo: repo.repo,
    owner: repo.owner,
    ref: 'refs/heads/gh-pages',
    path: versionsFile,
    headers: {
      accept: "application/vnd.github.v3.raw",
    }
  });
  if(versions.status === 200){
    return JSON.parse(versions.data);
  }
  throw new Error(
      `Current versions retrieval failed with status: ${versions.headers.status}`
  );
}
async function fetchVersions ( versionsFile , repo ) { const octokit = new Octokit ( ) ; const versions = await octokit . repos . getContent ( { repo : repo . repo , owner : repo . owner , ref : 'refs/heads/gh-pages' , path : versionsFile , headers : { accept : "application/vnd.github.v3.raw" , } } ) ; if ( versions . status === 200 ) { return JSON . parse ( versions . data ) ; } throw new Error ( ` ${ versions . headers . status } ` ) ; }
Fetch versions.json from gh-pages content
Fetch versions . json from gh - pages content