liuweiGL / vite-plugin-mkcert

Provide certificates for vite's https dev service.
https://www.npmjs.com/package/vite-plugin-mkcert
MIT License
541 stars 37 forks source link

Unable to use in github action because API rate limit exceeded #70

Closed abhishiv closed 5 months ago

abhishiv commented 1 year ago

Describe the bug

RequestError [HttpError]: API rate limit exceeded for 20.57.73.32. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)
    at /home/runner/work/mono/mono/node_modules/@octokit/request/dist-node/index.js:122:21
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async GithubSource.getSourceInfo (file:///home/runner/work/mono/mono/node_modules/vite-plugin-mkcert/dist/mkcert.mjs:278:22)
    at async Mkcert.getSourceInfo (file:///home/runner/work/mono/mono/node_modules/vite-plugin-mkcert/dist/mkcert.mjs:551:24)
    at async Mkcert.initMkcert (file:///home/runner/work/mono/mono/node_modules/vite-plugin-mkcert/dist/mkcert.mjs:572:24)
    at async Mkcert.init (file:///home/runner/work/mono/mono/node_modules/vite-plugin-mkcert/dist/mkcert.mjs:545:7)
    at async config (file:///home/runner/work/mono/mono/node_modules/vite-plugin-mkcert/dist/mkcert.mjs:673:7)
    at async runConfigHook (file:///home/runner/work/mono/mono/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:64543:25)
    at async resolveConfig (file:///home/runner/work/mono/mono/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:64026:14)
    at async _createServer (file:///home/runner/work/mono/mono/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:63274:20) {
  status: 403,
  response: {
    url: 'https://api.github.com/repos/FiloSottile/mkcert/releases/latest',
    status: 403,
    headers: {
      'access-control-allow-origin': '*',
      'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-RateLimit-Used, X-RateLimit-Resource, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset',
      'content-length': '277',
      'content-security-policy': "default-src 'none'; style-src 'unsafe-inline'",
      'content-type': 'application/json; charset=utf-8',
      date: 'Sat, 01 Jul 2023 13:38:07 GMT',
      'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
      server: 'Varnish',
      'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
      'x-content-type-options': 'nosniff',
      'x-frame-options': 'deny',
      'x-github-media-type': 'github.v3; format=json',
      'x-github-request-id': '8BC0:5438:156936B:2BDE127:64A02C3F',
      'x-ratelimit-limit': '60',
      'x-ratelimit-remaining': '0',
      'x-ratelimit-reset': '[16](https://github.com/graticohq/mono/actions/runs/5431338133/jobs/9877639354?pr=79#step:5:17)88219222',
      'x-ratelimit-resource': 'core',
      'x-ratelimit-used': '60',
      'x-xss-protection': '1; mode=block'
    },
    data: {
      message: "API rate limit exceeded for 20.57.73.32. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)",
      documentation_url: 'https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting'
    }
  },
  request: {
    method: 'GET',
    url: 'https://api.github.com/repos/FiloSottile/mkcert/releases/latest',
    headers: {
      accept: 'application/vnd.github.v3+json',
      'user-agent': 'octokit-rest.js/19.0.11 octokit-core.js/4.2.1 Node.js/[18](https://github.com/graticohq/mono/actions/runs/5431338133/jobs/9877639354?pr=79#step:5:19).16.1 (linux; x64)'
    },
    request: { hook: [Function: bound bound register] }
  }
}
soulhat commented 9 months ago

切换 source 为 coding 试下

mkcert({
  source: 'coding',
})
liuweiGL commented 9 months ago

Download the mkcert binary file to the project directory and specify the mkcertPath parameter.