Last active
January 5, 2021 14:52
-
-
Save ankjevel/e717add03c530717b36066a070b794ed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
token=xxx | |
org=Springworks | |
per_page=100 | |
url="https://api.github.com/orgs/${org}/repos?per_page=${per_page}" | |
pages=$(curl -H "Authorization: token ${token}" --silent "${url}" -I | awk '$1=/Link:/ {print $4}' | sed 's/.*page=//' | sed 's/\>;//') | |
for page in $(seq 1 ${pages:-1}) | |
do | |
for repo in $(curl -H "Authorization: token ${token}" --silent "${url}&page=${page}" | jq '.[] | select(.archived == false) | .ssh_url' | sed 's/\"//g') | |
do | |
git clone $repo -q | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment