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

feat: authenticate API requests with GITHUB_TOKEN to avoid rate-limit #12

Merged
merged 1 commit into from
Jan 11, 2023

Conversation

G-Rath
Copy link
Collaborator

@G-Rath G-Rath commented Jan 10, 2023

GH limits unauthenticated API requests to 60 an hour - GHA can authenticate using github.token which is always present to raise the limit to 1000 per hour.

Note that the GH API is only used for determining the latest version of Terminus so anyone specifying a specific version will not be rate limited, since the release download endpoint is not subject to rate limiting.

@G-Rath G-Rath requested a review from a team as a code owner January 10, 2023 20:30
@namespacebrian
Copy link
Contributor

namespacebrian commented Jan 11, 2023

How are the 60/hour requests counted when the requests originate from GHA? Is it per action, per project?

GHA can authenticate using github.token which is always present

Okay, please forgive my ignorance, but just to be clear, all GH actions already have github.token defined without any configuration steps being necessary, including at the project level?

Tracking internally as FEAT-1082

@namespacebrian
Copy link
Contributor

You're the original maintainer. I trust your judgment.

@namespacebrian namespacebrian merged commit aad6ca2 into main Jan 11, 2023
@namespacebrian namespacebrian deleted the G-Rath-patch-1 branch January 11, 2023 16:10
@namespacebrian
Copy link
Contributor

namespacebrian commented Jan 11, 2023

@G-Rath should I tag a release? 1.0.1? 1.1?

@G-Rath
Copy link
Collaborator Author

G-Rath commented Jan 11, 2023

How are the 60/hour requests counted when the requests originate from GHA? Is it per action, per project?

Honestly I'm not entirely sure beyond knowing that is it not less than "per workflow" - it could be per project, but the docs only say "Unauthenticated requests are associated with the originating IP address". When using the GITHUB_TOKEN through:

When using GITHUB_TOKEN, the rate limit is 1,000 requests per hour per repository.


just to be clear, all GH actions already have github.token defined without any configuration steps being necessary, including at the project level?

That is my understanding yes - according to these docs:

An action can access the GITHUB_TOKEN through the github.token context even if the workflow does not explicitly pass the GITHUB_TOKEN to the action

I've had a hunt around and not been able to find anyway to definitely completely disable the GITHUB_TOKEN (/ github.token), nor a clear way to remove permission for that particular API.

We've already been using this on another action I maintain without issue, and if someone does report an issue because of this change I'm happy to be pinged and look into it (especially since it'll probably impact my other action 😅)


should I tag a release? 1.0.1? 1.1?

yup, I think releasing this as v1.1.0 would make sense - thanks!

@namespacebrian
Copy link
Contributor

When I try to draft a new release, it shows this message saying it won't publish to GH marketplace because the action name isn't unique? I searched GH marketplace for "Setup Pantheon Terminus" and this action was the only result... :/

image

@G-Rath G-Rath mentioned this pull request Jan 18, 2023
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.

2 participants