This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
tasks:github_permissions [2020/05/15 14:54] djgalloway created |
tasks:github_permissions [2021/07/14 19:14] (current) djgalloway [Listing All Users] |
||
---|---|---|---|
Line 8: | Line 8: | ||
- Enter the user's GitHub username | - Enter the user's GitHub username | ||
- {{:tasks:invite.png?nolink}} | - {{:tasks:invite.png?nolink}} | ||
+ | |||
+ | ==== Listing All Users in All Teams ==== | ||
+ | Make sure you have a github API token written to ''~/.github_token'' | ||
+ | |||
+ | <code> | ||
+ | for num in {1..10}; do for url in $(curl -s -H "Accept: application/vnd.github.v3+json" -H "Authorization: token $(cat ~/.github_token)" https://api.github.com/orgs/ceph/teams | jq '.[].url' | tr -d '"'); do curl -s -H "Accept: application/vnd.github.v3+json" -H "Authorization: token $(cat ~/.github_token)" ${url}/members | jq '.[].login' | tr -d '"'; done; done | sort | uniq | ||
+ | </code> |