I'm trying to get a list of an organization's all repositories, including private ones. (Or to be more specific, all of the private repositories a certain user has access to.)
Reqesting info for the organization (https://api.github.com/orgs/acme?access_token=[...]
) shows that there indeed are plenty of private repositories:
... "public_repos": 5, "total_private_repos": 68, "owned_private_repos": 68, ...
(The access token I'm using had been previously generated using the API for username/passwd.)
But whatever I try to list the repos...
https://api.github.com/orgs/acme/repos?access_token=[...]
...GitHub API just returns the 5 public repositories. (Documentation says type=all
is default. Also tried adding the parameter type=private
; no difference.)
Any idea what I'm doing wrong?
The user to whom the access token was generated in fact has Push & Pull access to just some of the organization's private repositories, but none of those appear in the list I get (just the 5 public repositories).
Public repositories are accessible to everyone on the internet. Private repositories are only accessible to you, people you explicitly share access with, and, for organization repositories, certain organization members.
Hitting https://api.github.com/users/USERNAME/repos will list public repositories for the user USERNAME. Show activity on this post. to find all the user's repos.
You can search globally across all of GitHub, or scope your search to a particular repository or organization. To search globally across all of GitHub, type what you're looking for into the search field at the top of any page, and choose "All GitHub" in the search drop-down menu.
Everything you are doing is OK. However, when creating OAuth tokens for authentication, be sure that you are defining the right scopes. Each scope defines a specific set of permitted actions (information you can read/write), so you should check that you are creating the token with the repo
scope.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With