Skip to content

Instantly share code, notes, and snippets.

@eddiewebb
Last active August 7, 2018 00:00
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eddiewebb/041f4114f214a67c5fbd20915f04a1e7 to your computer and use it in GitHub Desktop.
Save eddiewebb/041f4114f214a67c5fbd20915f04a1e7 to your computer and use it in GitHub Desktop.
GitHub Contributor count/list by org
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
@eddiewebb
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment