actions / create-github-app-token

GitHub Action for creating a GitHub App Installation Access Token
https://github.com/marketplace/actions/create-github-app-token
MIT License
381 stars 55 forks source link

Log rate limit status #154

Open scootafew opened 3 months ago

scootafew commented 3 months ago

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 commented 3 months ago

GitHub apps use two different types of authentication

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 commented 3 months ago

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 commented 3 months ago

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