Last active
December 5, 2017 16:46
-
-
Save swinton/79a84b17c256940a2821cbdefaf9f069 to your computer and use it in GitHub Desktop.
Exports members of GitHub org as a CSV
This file contains hidden or 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 | |
# | |
# Exports members of an org as a CSV | |
# Usage: | |
# ./gh-org-members.sh > members.csv | |
# Dependencies: | |
# - jq (https://github.com/stedolan/jq) | |
export GITHUB_TOKEN="[your personal access token]" | |
export GITHUB_ORG="[your org]" | |
curl -H "Authorization: token ${GITHUB_TOKEN}" \ | |
https://api.github.com/orgs/${GITHUB_ORG}/members | \ | |
jq -r '.[] | [.login, .url] | @csv' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment