Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci,lib.sh: print Github API rate limits #341

Merged
merged 1 commit into from
Jan 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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