Skip to content

Commit

Permalink
Improve repositores code
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Sverdlov <[email protected]>
  • Loading branch information
sverdlov93 committed Oct 13, 2024
1 parent ee1c68d commit eb35483
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,6 @@ jobs:
CLAssistant:
runs-on: ubuntu-latest
steps:
- name: Make API Request and Check Rate Limit
run: |
RESPONSE_HEADERS=$(curl -I -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/rate_limit)
LIMIT=$(echo "$RESPONSE_HEADERS" | grep -i "X-RateLimit-Limit" | awk '{print $2}')
REMAINING=$(echo "$RESPONSE_HEADERS" | grep -i "X-RateLimit-Remaining" | awk '{print $2}')
RESET=$(echo "$RESPONSE_HEADERS" | grep -i "X-RateLimit-Reset" | awk '{print $2}')
echo "Rate Limit: $LIMIT"
echo "Remaining Requests: $REMAINING"
# Check if the remaining value is a number before comparing
if [[ "$REMAINING" =~ ^[0-9]+$ && "$REMAINING" -eq 0 ]]; then
RESET_DATE=$(date -d @"$RESET")
echo "Rate limit exceeded. Resets at: $RESET_DATE"
exit 1
fi
- name: Run CLA Check
uses: jfrog/.github/actions/cla@main
with:
Expand Down

0 comments on commit eb35483

Please sign in to comment.