简体   繁体   English

如何从Github API获取私有组织存储库的列表?

[英]How to get list of private organization repository from Github API?

我想从Github API V 3.0中检索私有组织存储库,我在组织帐户中有一个私有存储库,当我要获取存储库时,API只会返回我的公共存储库和公共叉存储库,但私有存储库不会检索,任何想法?

If the repo is under an organization, you need to retrieve a list of organization repos, not your own user repos. 如果回购在组织下,则需要检索组织回购列表,而不是您自己的用户回购。 So, instead of using this: 所以,不要使用这个:

http://developer.github.com/v3/repos/#list-user-repositories http://developer.github.com/v3/repos/#list-user-repositories

you need to use this: 您需要使用此:

http://developer.github.com/v3/repos/#list-organization-repositories http://developer.github.com/v3/repos/#list-organization-repositories

Solved! 解决了! I was using github-node and called the getFromUser method but should've used the getAll method for retrieving both private and public repos. 我当时使用github-node并调用了getFromUser方法,但应该使用getAll方法来检索私有和公共仓库。 It also returns private-organization repositories that I fork. 它还返回我分叉的私有组织存储库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM