Skip to content

Conversation

@varl
Copy link
Contributor

@varl varl commented May 4, 2023

Adds the octokit plugin for throttling / rate-limiting to fix the problem where action runs get blocked with a 403 error1.

The github.getOctokit2 function accepts a list of plugins, so this passes in the throttling plugin3 to be hooked into the octokit instance.

It also needs some configuration to setup the throttle mechanisms, passed in to the getOctokit function.

closes #192

@changeset-bot
Copy link

changeset-bot bot commented May 4, 2023

🦋 Changeset detected

Latest commit: de4dff0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@changesets/action Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

varl and others added 4 commits May 4, 2023 20:33
Adds the octokit plugin for throttling / rate-limiting to fix the
problem where action runs get blocked with a 403 error[1].

The `github.getOctokit`[2] function accepts a list of plugins, so this
passes in the `throttling` plugin[3] to be hooked into the octokit
instance.

It also needs some configuration to setup the `throttle` mechanisms,
passed in to the `getOctokit` function.

[1]: #192
[2]: https://github.com/actions/toolkit/blob/main/packages/github/src/github.ts#LL18C40-L18C40
[3]: https://github.com/octokit/plugin-throttling.js
Based on additional docs, the callbacks seem to have changes to their
signatures[1]. This change aligns this implementation with the docs[2].

[1]: https://octokit.github.io/rest.js/v19#throttling
[2]: https://github.com/octokit/plugin-throttling.js/blob/v5.1.1/src/index.ts#L90-L91
@varl varl requested a review from Andarist May 5, 2023 10:56
@Andarist Andarist merged commit 225a1e8 into changesets:main May 6, 2023
@github-actions github-actions bot mentioned this pull request May 6, 2023
@varl varl deleted the request-throttling branch May 7, 2023 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

403: You have exceeded a secondary rate limit

2 participants