website/inject.js
async function injectGhStars () {
  const opts = {}
  if ('GITHUB_TOKEN' in process.env) {
    opts.auth = process.env.GITHUB_TOKEN
  }

  const Octokit = require('@octokit/rest')
  const octokit = new Octokit(opts)

  let { headers, data } = await octokit.repos.get({
    owner: 'transloadit',
    repo: 'uppy'
  })

  console.log(`${headers['x-ratelimit-remaining']} requests remaining until we hit GitHub ratelimiter`)

  let dstpath = path.join(webRoot, 'themes', 'uppy', 'layout', 'partials', 'generated_stargazers.ejs')
  fs.writeFileSync(dstpath, data.stargazers_count, 'utf-8')

  console.log(`${data.stargazers_count} stargazers written to '${dstpath}'`)
}
async function injectGhStars () {
  const opts = {}
  if ('GITHUB_TOKEN' in process.env) {
    opts.auth = process.env.GITHUB_TOKEN
  }

  const Octokit = require('@octokit/rest')
  const octokit = new Octokit(opts)

  let { headers, data } = await octokit.repos.get({
    owner: 'transloadit',
    repo: 'uppy'
  })

  console.log(`${headers['x-ratelimit-remaining']} requests remaining until we hit GitHub ratelimiter`)

  let dstpath = path.join(webRoot, 'themes', 'uppy', 'layout', 'partials', 'generated_stargazers.ejs')
  fs.writeFileSync(dstpath, data.stargazers_count, 'utf-8')

  console.log(`${data.stargazers_count} stargazers written to '${dstpath}'`)
}
async function injectGhStars ( ) { const opts = { } if ( 'GITHUB_TOKEN' in process . env ) { opts . auth = process . env . GITHUB_TOKEN } const Octokit = require ( '@octokit/rest' ) const octokit = new Octokit ( opts ) let { headers , data } = await octokit . repos . get ( { owner : 'transloadit' , repo : 'uppy' } ) console . log ( ` ${ headers [ 'x-ratelimit-remaining' ] } ` ) let dstpath = path . join ( webRoot , 'themes' , 'uppy' , 'layout' , 'partials' , 'generated_stargazers.ejs' ) fs . writeFileSync ( dstpath , data . stargazers_count , 'utf-8' ) console . log ( ` ${ data . stargazers_count } ${ dstpath } ` ) }
re-enable after rate limiter issue is fixed
re - enable after rate limiter issue is fixed