Last active
August 24, 2018 06:49
-
-
Save joerx/254a861659bfac86197a73eeb9f3ea29 to your computer and use it in GitHub Desktop.
Delete member from all Github team memberships. Careful with this!
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
curl -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/user/teams | jq -r '.[] | [.organization.name, .name, (.id|tostring)] | join("|")' | grep -v $DONT_DELETE_FROM_THIS | awk -F '|' '{ print "https://api.github.com/teams/" $3 "/memberships/$USERNAME" }' | xargs -I {} curl -H"Authorization: token $GITHUB_TOKEN" -XDELETE {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment