Skip to content

Instantly share code, notes, and snippets.

@g-a-d
Created November 29, 2021 09:36
Show Gist options
  • Save g-a-d/4e460c3a6b1a2eb1693eaef529cbe057 to your computer and use it in GitHub Desktop.
Save g-a-d/4e460c3a6b1a2eb1693eaef529cbe057 to your computer and use it in GitHub Desktop.
Dump email addresses from multiple github organizations
export TOKEN="github_personal_access_token"
for org in Org1 Org2 Org3 Org4 ; do \
curl -G 'https://api.github.com/scim/v2/organizations/'"$org"'/Users?Count=1000' \
-H "Authorization: token $TOKEN" -H "Accept: application/vnd.github.v3+json" | \
jq -r ".Resources[].emails[0] | [\"$org\", .value] | @csv"
done >> emails.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment