Github Rate limits

Rate limits are sometimes scary. Sometimes its temporary, some time it goes away soon…some time it takes like foreverrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr

I got rate limited by github by using its gh cli inside github actions. Well i didnt spam it but i was using more of it in a very less amount of time. Ran the action almost 200 times a day and the amount of action it did inside that 200 run each time is huge considering what i was doing (Was testing and developing a tool to run with github a actions)

Would have been nice for a test environment if github was providing one but sadly they dont…..

Also i was using my own (The company’s self hosted github actions server)

And finally i got blocked and rate limited heavily.

I was curious to find out what my limits are for these actions and i found this out

curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-GITHUB-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/rate_limit

More info here https://docs.github.com/en/rest/rate-limit/rate-limit?apiVersion=2022-11-28

And when you run the above code you shall be able to see and know you rate limits.

Some limits are for per minute and per hour and per day basis so be careful when exhausting them

You should get something like this as out for that code