Skip to content

Commit

Permalink
report unexpected API status code as error, as a check on auth token
Browse files Browse the repository at this point in the history
Signed-off-by: Jef Spaleta <[email protected]>
  • Loading branch information
jspaleta committed Feb 12, 2025
1 parent 7d6414b commit 993af27
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/lint_members.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ page=1
flag=true
logins=()
while $flag; do
status=$(curl --head --location --connect-timeout 5 --write-out %{http_code} --silent --output /dev/null -H "Authorization: Bearer $GITHUB_TOKEN" ${url}?page=${page})
if [[ "$status" -gt 399 ]] ; then
echo "GitHub API Status Code: $status"
exit 1
fi
response=$( curl -s -I -H "Authorization: Bearer $GITHUB_TOKEN" "${url}?page=${page}" )
# Append to logins array
logins+=( `curl --no-progress-meter -L \
Expand Down

0 comments on commit 993af27

Please sign in to comment.