Open andyfeller opened 2 years ago
Verifying that the attempts remaining notice is specifically GraphQL limit only 👍
CheckAPILimit() {
##############################################################
# Check what is remaining, and if 0, we need to sleep it off #
##############################################################
API_REMAINING_REQUEST=$(curl -s -X GET \
--url "${GITHUB_URL}/rate_limit" \
-H "Authorization: Bearer ${GITHUB_TOKEN}")
Debug "DEBUG --- API REMAINING DATA BLOCK:"
DebugJQ "${API_REMAINING_REQUEST}"
API_REMAINING_MESSAGE=$(echo "${API_REMAINING_REQUEST}" \
| jq -r '.message' 2>&1)
if [[ "${API_REMAINING_MESSAGE}" != "Rate limiting is not enabled." ]]; then
API_REMAINING=$(echo "${API_REMAINING_REQUEST}" \
| jq -r '.resources.graphql.remaining' 2>&1);
else
API_REMAINING=9999999999
fi
Overview
I'm working with a customer leveraging the
gh-repo-stats
extension as they find the final evaluation of whether there might be issues as helpful for migration planning. Thank you for building and maturing this extension! 🎉 🙇@saharora and I ran into an issue after ~67 repositories were assessed. In a rough estimation, 100 API calls are being made for each repository, assuming no other activity against the PAT was going on at the time. I need to look at the underlying code again to see how much of the information is coming from GraphQL or not to see if there might be room for optimization.
Ask