I am using the below script to generate a list of repositories in one of my GitHub Enterprise orgs and it works fine; however, by default it only fetches 100 repos at a time.
How can I modify it to generate the entire list? I have some 2000 repos in my GitHub org.
curl --silent --user "myusername:mypassword" "https://github.***.com/api/v3/orgs/myorg/repos?page=1&per_page=2000" | npx jq '.[].clone_url' | while read repo
do
repo="${repo%"}"
repo="${repo#"}"
echo "$repo"
done > repolist.txt
I am unable to tweak the page=*&per_page=*
here and no matter what number combinations I use, when I execute the above shell script, a file called repolist.txt
is generated with the list of first 100 repos in the GitHub org.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…