fix: prevent chance of rate limits when querying GitHub because of unauthenticated calls; fix tests, upgrade deprecated dependency #6
+2,129
−320
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
the unauthenticated limit to calling GitHub's API is 60/hour, and this limit is assigned to the IP address of the caller. in rare cases, you could be be running this action on a runner that has had its limit exhausted by other users which will cause this action to fail due to getting a rate limit error response. this is more likely to occur on self-hosted runners, especially if a runner label that maps to few individual runners is frequently used.
Solution
the env var
GITHUB_TOKEN
is set to a provisioned token for each action run, so its limits are isolated (and much higher); therefore, if we use it in the Octokit client then the only way an error can occur is if the action run exhausts the limit itself.Additionally...
test.js
to pass and added comments to give future devs a heads upactions/core
dependency as current version is deprecated (pending deletions)