# Script to generate Status.md containing the headers and status badges of the Top N rated by stars GitHub repos across all CI platforms on a single page
#
# Usage:
#
# without arguments queries for all non-fork repos for your $USER and iterate them up to $top_N to generate the page
#
# github_generate_status_page.sh
#
# with arguments will query those repo's README.md at the top level
# use authenticated requests if you are hitting the API rate limit - this is automatically done above now if USER/PASSWORD GITHUB_USER/GITHUB_PASSWORD/GITHUB_TOKEN environment variables are detected
# eg. CURL_OPTS="-u harisekhon:$GITHUB_TOKEN" ...
# shellcheck disable=SC2086
if ! output="$(curl -sS --connect-timeout 3${CURL_OPTS:-}"https://api.github.com/users/$USER/repos?page=$page&per_page=100")";then