Skip to content

Instantly share code, notes, and snippets.

@eddiewebb eddiewebb/count.sh
Last active Aug 7, 2018

Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

eddiewebb commented Jul 16, 2018

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
You can’t perform that action at this time.