Skip to content

Instantly share code, notes, and snippets.

@robinbowes
Created November 19, 2020 17:55
Show Gist options
  • Save robinbowes/0823e4172bca9126383eea285218aef5 to your computer and use it in GitHub Desktop.
Save robinbowes/0823e4172bca9126383eea285218aef5 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -euo pipefail
page=1
repo_list=()
while true ; do
output=$(hub api -XGET -F type=all -F page=$page -F per_page=100 /user/repos | jq -r '.[].full_name')
if [[ -n $output ]]; then
readarray -t chunk <<<"$output"
repo_list+=("${chunk[@]}")
else
break
fi
((page+=1))
done
printf '%s\n' "${repo_list[@]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment