2017-03-01 86 views
2

我是github公司git repo的贡献者。找出管理员是否是git repo

我想找出谁是贡献者中的谁是管理员。

除了出门在外并询问公司的每个人以外,我怎么知道谁是管理员?

+0

我不认为有一种方法可以在Github上自己搞清楚。 – Mark

回答

3

如果你有这个仓库的推送权限,可以使用Github的API找到collaborators

您将需要一个access token,端点https://api.github.com/repos/ORG/REPO/collaborators?access_token=ACCESS_TOKEN给你所有的合作者许可类型为每个列表的列表其中:

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

您可以使用curljq(解析JSON响应)是这样的:

curl https://api.github.com/repos/ORG/REPO/collaborators?access_token=ACCESS_TOKEN | \ 
    jq '[ .[] | select(.permissions.admin == true) | .login ]' 
+0

Def不是我期待的,但做的工作。你统治@Bertrand Martel – ThinkBonobo

相关问题