Find out the admin(s) for a git repo

If you have push access to this repository, you can use Github API to find collaborators

You will need an access token, the endpoint https://api.github.com/repos/ORG/REPO/collaborators gives you a list of all collaborators with the list of permission type for each of them :

"permissions": {
    "admin": true,
    "push": true,
    "pull": true
  }

You can use curl and jq (to parse JSON response) like this :

curl https://api.github.com/repos/ORG/REPO/collaborators \
     -H "Authorization: Token ACCESS_TOKEN" | \
     jq '[ .[] | select(.permissions.admin == true) | .login ]'

Leave a Comment