Created
July 4, 2022 18:59
-
-
Save gmelodie/7ca4f25c1fb2b2c7c9e0e9e36338b4d1 to your computer and use it in GitHub Desktop.
Get SSH keys for all the members of a github team
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
APITOKEN="" # TODO: add your token here (create one: https://github.com/settings/tokens) | |
# be sure to check if the token hasn't expired! | |
# for ORG and TEAM, you can get those by navigating to your team on github | |
# and seeing the url, which will be in the format: | |
# https://github.com/orgs/{ORG}/teams/{TEAM}/discussions | |
# e.g. https://github.com/orgs/application-research/teams/a-team/discussions | |
ORG="application-research" | |
TEAM="a-team" | |
USERS=$(curl -s -S -H "Accept: application/vnd.github+json" -H "Authorization: token $APITOKEN" \ | |
https://api.github.com/orgs/$ORG/teams/$TEAM/members \ | |
| jq -r ".[].login") | |
for usr in $USERS | |
do | |
echo \# $usr | |
curl -s -S https://github.com/$usr.keys | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Very cool