Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rate limit issue with EditorConfig checker CLI #4422

Merged
merged 2 commits into from
Nov 6, 2023

Conversation

colinrotherham
Copy link
Contributor

@colinrotherham colinrotherham commented Nov 3, 2023

Closes #4224 as part of #4223

This PR fixes an issue where the editorconfig-checker npm package throws a GitHub REST API error:

Failed to download binary:
HttpError: API rate limit exceeded for 40.84.178.209. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)

On first run, the editorconfig-checker npm package (Node.js) downloads its binary (Go) from GitHub releases

Steps to reproduce

Run these steps too many times:

  1. Use GitHub Actions to run npm run lint:editorconfig
  2. EditorConfig checker Node.js from editorconfig-checker hits GitHub REST API to check for latest release
  3. EditorConfig checker binary from editorconfig-checker releases is downloaded to /home/runner/work/_temp/
  4. EditorConfig checker binary runs

The problem

The error throws from step 2) above via @octokit/rest (GitHub REST API client for JavaScript) in lines:

https://github.com/editorconfig-checker/editorconfig-checker.javascript/blob/b6f19742da5d22e47ca09884b13c0bed03b551f1/src/release.ts#L12-L15

The fix

This PR adds GITHUB_TOKEN similar to our own GitHub REST API calls (#3229, #3282)

@colinrotherham colinrotherham added 🐛 bug Something isn't working the way it should (including incorrect wording in documentation) github_actions Pull requests that update GitHub Actions code labels Nov 3, 2023
@colinrotherham colinrotherham requested a review from a team as a code owner November 3, 2023 10:45
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-4422 November 3, 2023 10:45 Inactive
Copy link

github-actions bot commented Nov 3, 2023

📋 Stats

File sizes

File Size
dist/govuk-frontend-5.0.0-beta.0.min.css 114 KiB
dist/govuk-frontend-5.0.0-beta.0.min.js 37.85 KiB
packages/govuk-frontend/dist/govuk/all.bundle.js 77.08 KiB
packages/govuk-frontend/dist/govuk/all.bundle.mjs 72.37 KiB
packages/govuk-frontend/dist/govuk/all.mjs 3.8 KiB
packages/govuk-frontend/dist/govuk/govuk-frontend-component.mjs 359 B
packages/govuk-frontend/dist/govuk/govuk-frontend.min.css 113.99 KiB
packages/govuk-frontend/dist/govuk/govuk-frontend.min.js 37.92 KiB
packages/govuk-frontend/dist/govuk/i18n.mjs 5.3 KiB

Modules

File Size
all.mjs 68.7 KiB
components/accordion/accordion.mjs 21.35 KiB
components/button/button.mjs 4.48 KiB
components/character-count/character-count.mjs 20.79 KiB
components/checkboxes/checkboxes.mjs 5.61 KiB
components/error-summary/error-summary.mjs 5.79 KiB
components/exit-this-page/exit-this-page.mjs 15.79 KiB
components/header/header.mjs 3.68 KiB
components/notification-banner/notification-banner.mjs 4.32 KiB
components/radios/radios.mjs 4.6 KiB
components/skip-link/skip-link.mjs 3.6 KiB
components/tabs/tabs.mjs 9.37 KiB

View stats and visualisations on the review app


Action run for 1184c15

Copy link
Member

@romaricpascal romaricpascal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GITHUB_TOKEN is configured for restricted access, so I think it's fine to have it as an env variable.

Let's see if that sorts the download of editorconfig-checker 🤞🏻 ⛵

@colinrotherham colinrotherham merged commit 25f4379 into main Nov 6, 2023
46 checks passed
@colinrotherham colinrotherham deleted the editorconfig-github-token branch November 6, 2023 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working the way it should (including incorrect wording in documentation) github_actions Pull requests that update GitHub Actions code
Projects
Development

Successfully merging this pull request may close these issues.

Fix rate limit issue with EditorConfig checker CLI
3 participants