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

Log rate limit status #154

Open
scootafew opened this issue Jul 10, 2024 · 3 comments
Open

Log rate limit status #154

scootafew opened this issue Jul 10, 2024 · 3 comments

Comments

@scootafew
Copy link

I'm not sure if it would be worth making a dedicated request to https://api.github.com/rate_limit in this action to fetch this info, but I am assuming the API calls for token issuance/revocation return the usual rate limit headers? If so it would be nice to log these so that users can see the value of x-ratelimit-remaining for the authenticated app.

@gr2m
Copy link
Contributor

gr2m commented Jul 10, 2024

GitHub apps use two different types of authentication

  • JWT for GitHub App authentication which is global and used e.g. for GET /app or to create the installation access tokens
  • The installation access tokens that are limited to the respective installation.

So the request that creates the token won't include the rite rate limit in its response, but revoking the access token will. Or we could log both 🤷

making a dedicated request to https://api.github.com/rate_limit in this action to fetch this info

If that's information you need, it would be simple enough to just do so in an additional step, e.g. with run: gh api rate_limit

@scootafew
Copy link
Author

Right I see, that does make sense. I guess logging it in the post step could still be useful.

I can of course add a dedicated step to do this, I was just wondering if I could avoid adding that logic everywhere, since I use this action in quite a lot of jobs... and I thought it could be useful for others too.

I would have been tempted to create a wrapper action which called this one and implemented that logic but from what I remember composite actions don't support post steps

@gr2m
Copy link
Contributor

gr2m commented Jul 11, 2024

Can you explain the problem it would solve if we logged rate limits?

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

No branches or pull requests

2 participants