pipelines-as-code icon indicating copy to clipboard operation
pipelines-as-code copied to clipboard

Check the rate limitation before starting e2e

Open chmouel opened this issue 2 years ago • 0 comments

do something like this at the beginning of the workflow pipeline :

[[ $(curl -i -s -H "Authorization: Bearer $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3+json" https://api.github.com/rate_limit|grep x-ratelimit-remaining|sed 's/.*: //') -lt 30 ]] && {
  echo "token is rate limited"
  exit 1
}

not tested

chmouel avatar Dec 12 '22 15:12 chmouel