Last active
August 7, 2018 00:00
-
-
Save eddiewebb/041f4114f214a67c5fbd20915f04a1e7 to your computer and use it in GitHub Desktop.
GitHub Contributor count/list by org
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
GH_TOKEN="1234" | |
ORG_NAME="some-org" | |
curl -H "Authorization: token ${GH_TOKEN}" https://api.github.com/orgs/${ORG_NAME}/repos | jq -r '.[].url' > /tmp/repos | |
rm /tmp/repos 2>/dev/null | |
while read REPO;do | |
curl -H "Authorization: token ${GH_TOKEN}" ${REPO}/contributors 2>/dev/null | jq -r '.[].login' >> /tmp/users | |
done < /tmp/repos | |
cat /tmp/users | sort -u | wc -l |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Worth noting the /tmp/repos and /tmp/users will be left in place after each run if you want a listing as well as count.