Skip to content

Commit

Permalink
Merge pull request analogdevicesinc#341 from analogdevicesinc/build-p…
Browse files Browse the repository at this point in the history
…rint-remaining-api-limits

ci,lib.sh: print Github API rate limits
  • Loading branch information
dNechita authored Jan 16, 2020
2 parents 1984e85 + df51cc1 commit aef5c46
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion CI/travis/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,18 @@ ensure_command_exists() {
return 1
}

print_github_api_rate_limits() {
# See https://developer.github.com/v3/rate_limit/
# Note: Accessing this endpoint does not count against your REST API rate limit.
echo_green '-----------------------------------------'
echo_green 'Github API Rate limits'
echo_green '-----------------------------------------'
wget -q -O- https://api.github.com/rate_limit
echo_green '-----------------------------------------'
}

ensure_command_exists sudo
ensure_command_exists wget

# Other scripts will download lib.sh [this script] and lib.sh will
# in turn download the other scripts it needs.
Expand All @@ -313,7 +324,8 @@ for script in $COMMON_SCRIPTS ; do
[ ! -f "ci/travis/$script" ] || continue
[ ! -f "${LOCAL_BUILD_DIR}/$script" ] || continue
mkdir -p ${LOCAL_BUILD_DIR}
ensure_command_exists wget
wget https://raw.githubusercontent.com/analogdevicesinc/libiio/master/CI/travis/$script \
-O $LOCAL_BUILD_DIR/$script
done

print_github_api_rate_limits

0 comments on commit aef5c46

Please sign in to comment.