pipelines-as-code
pipelines-as-code copied to clipboard
Check the rate limitation before starting e2e
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