How to get all user repositories by github api? (including Pinned repositories)

心已入冬 提交于 2019-12-04 15:32:50

Not all of the user's pinned repositories belong to that user—they belong to organisations that the user happens to be a member of, so they won't show up when asking the API for the user's repositories via GET /users/:user/repos (apologies, I'm not familiar with PyGithub so I'll speak only in the standard API URLs).

There's no easy way to get a list of repositories that a user contributes to without making multiple API queries—for example to get a list of organisations the user belongs to (GET /user/:user/orgs), and then listing the repositories in that organisation (GET /orgs/:org/repos). However, using this approach there's no guarantee the user contributed to each repository in the organisation.

You could of course further filter by commit authors, but at this point you will probably have expended a lot of effort (and rate limit).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!