Last active
March 6, 2020 15:47
-
-
Save ake-persson/f1313b9209ea7c2e66be5141a8b8f974 to your computer and use it in GitHub Desktop.
Get Org. GitHub users
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
#/bin/bash | |
URL="https://api.github.com" | |
AUTH="Authorization: token $(cat ~/.ghtoken)" | |
curl -s -H "${AUTH}" "${URL}/orgs/IndependentIP/members?page=1&per_page=1000" >users.json | |
echo "login,site_admin,name,email" | |
for u in $(jq -r '.[] | "\(.login),\(.site_admin),\(.url)"' users.json); do | |
curl -s -H "$AUTH" "${u##*,}" | jq -r ". | \"${u%,*},\(.name),\(.email)\"" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment