-
-
Save KyMidd/cf4119e6037cecd6b03891faa94d3b20 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # If API rate-limiting is hit, sleep for 1 minute | |
| # Rounded parenthesis are used to trigger arithmetic expansion, which compares more than the first numeric digit (bash is weird) | |
| if (( "$API_RATE_LIMIT_UNITS_REMAINING" < 100 )); then | |
| echo "ℹ️ We have less than 100 GitHub API rate-limit tokens left, sleeping for 1 minute" | |
| sleep 60 | |
| # If API rate-limiting shows remaining units, break out of loop and function | |
| else | |
| echo ℹ️ Rate limit checked, we have "$API_RATE_LIMIT_UNITS_REMAINING" core tokens remaining so we are continuing | |
| break | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment