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

Use GHA's token #310

Merged
merged 4 commits into from
Feb 12, 2025
Merged

Use GHA's token #310

merged 4 commits into from
Feb 12, 2025

Conversation

lishaduck
Copy link
Contributor

@lishaduck lishaduck commented Nov 11, 2024

GHA provides a token itself, we don't need to generate one. This is more-fine grained, easier to change if needed, and more secure.

I think the existing contents: read is sufficient, but it might not be. We'll see.

Based on #309 (comment).

Closes #336.

@lishaduck
Copy link
Contributor Author

lishaduck commented Nov 11, 2024

Oh, the script needs a username. I'll think on this.

@lishaduck lishaduck marked this pull request as draft November 11, 2024 02:14
@lishaduck
Copy link
Contributor Author

Ok, so the GITHUB_TOKEN is for a builtin github app, not your own account, so that i.e., contributing to a project with extensive doesn't use up your personal rate. Thus, there's not a username associated with it. However, I think we don't need a username to make authenticated requests, do we? Could we make it optional?

@lishaduck lishaduck changed the title ci: use actions' token Use GHA token Nov 11, 2024
@lishaduck lishaduck changed the title Use GHA token Use GHA's token Nov 11, 2024
@lishaduck
Copy link
Contributor Author

Hmm, looks like it's not picking up AUTH_GITHUB.

@lishaduck
Copy link
Contributor Author

lishaduck commented Dec 5, 2024

It's worth noting that the workflow token is only 1000 requests per hour, whereas a pat is 5000, so this is only helpful if we've got over 5 pushers an hour.

EDIT: So there's some useful stuff in here, but using gha's token doesn't help.

@lishaduck lishaduck force-pushed the rate-limit-token branch 2 times, most recently from 1f6fd01 to 993a0ed Compare December 5, 2024 17:53
@lishaduck
Copy link
Contributor Author

lishaduck commented Dec 5, 2024

Hit #313/#324, blocking on #325.

@lishaduck
Copy link
Contributor Author

I'll try to rebase this when I get a moment, I still think this should fix rate limiting (because secrets isn't injected into ENV), and still obsolete needing @jfmengels' token.

@jfmengels
Copy link
Owner

This looks to work promisingly.

@lishaduck
Copy link
Contributor Author

It passes CI now!

@lishaduck lishaduck marked this pull request as ready for review February 12, 2025 17:29
GHA provides a token itself, we don't need to generate one.
This is more-fine grained, easier to change if needed, and more secure.

I think the existing `contents: read` is sufficient, but it might not be.
We'll see.
* Don't tell authenticated users to log in.
* Tell users when the rate limit expires.
@lishaduck lishaduck marked this pull request as draft February 12, 2025 17:32
@lishaduck lishaduck marked this pull request as ready for review February 12, 2025 17:34
@jfmengels jfmengels merged commit 7c447f3 into jfmengels:main Feb 12, 2025
3 checks passed
@lishaduck lishaduck deleted the rate-limit-token branch February 12, 2025 21:21
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.

Resupport GH Auth
2 participants