Skip to content

Instantly share code, notes, and snippets.

@Aleyasen

Aleyasen/github.md

Last active Jan 28, 2019
Embed
What would you like to do?
Use Github API to make daily Github administration routines much easier! (especially if you/your company has a lot of repositories)

You need ok.sh (https://github.com/whiteinge/ok.sh) and JQ (http://stedolan.github.io/jq) to use these snippets.

  • Delete a collaborator from all of your repositories (e.g. in case a developer left the company)
ok.sh -j list_repos | jq -r -c '.[] | "\(.full_name)"' | xargs -I % sh -c './ok.sh -y delete_collaborator % [USERNAME]'
  • List all the collaborators for all of your repositories (e.g. to double-check all the repo accesses are legitimate)
ok.sh -j list_repos | jq -r -c '.[] | "\(.full_name)"' | xargs -I % sh -c './ok.sh list_collaborators %' 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment