From docs
You can specify how many items to receive (up to a maximum of 100);
You can go to /orgs/{org}
and read public_repos
With this value, you can make total_pages=$(($public_repos / 100 + 1))
and iterate in total_pages
incrementing your page
prop.
Below is a small code, just add your credentials and Org Name:
#!/bin/bash
user=""
password=""
org=""
public_repos=$(curl -s -u "${user}:${password}" "https://api.github.com/orgs/${org}" | jq .public_repos)
per_page=100
total_pages=$(($public_repos / $per_page + 1))
for page in $(seq 1 $total_pages); do
curl -s -u "${user}:${password}"
"https://api.github.com/orgs/${org}/repos?page=${page}&per_page=${per_page}" |
jq -r '.[].clone_url'
done
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…