找出谁是git仓库的管理员 [英] Find out who is the admin(s) for a git repo

查看:56
本文介绍了找出谁是git仓库的管理员的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是github中一家公司的git repo的贡献者.

I am a contributor for a git repo in github for a company.

我想找出谁是管理员.

除了四处询问公司中的每个人之外,我如何找出管理员?

How do I find out who is the admin besides going around and asking everyone in the company?

推荐答案

如果您具有对此存储库的推送访问权限,则可以使用Github API查找

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

您将需要一个访问令牌,即端点 https://api.github.com/repos/ORG/REPO/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
  }

您可以使用 curl

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 ]'

这篇关于找出谁是git仓库的管理员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆