Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub API: using 'repo' scope, but still can't see private repos

Per the GitHub API docs, I am requesting the repo scope which gives access to private repositories.

The user is presented with the following dialog, which also mentions private repos. They accept the application.

enter image description here

Despite this, when using the oauth access token obtained when asking for 'repo' access, I can only see public repos when I GET https://api.github.com/users/someusername/repos. No private repos are shown.

The user account is my own, and I have not revoked access.

How can I see private repos using the GitHub API V3?

like image 358
mikemaccana Avatar asked Feb 20 '14 12:02

mikemaccana


People also ask

Do private repos show up on GitHub?

Your GitHub profile shows a graph of your repository contributions over the past year. You can choose to show anonymized activity from private and internal repositories in addition to the activity from public repositories.

Can private repositories be seen?

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.

What happens to private repositories GitHub?

Your private repositories will not be deleted and they will not be made public. Of course, if you ever have any troubles, you can always email [email protected].


1 Answers

From testing:

  • GETing /users/someusername/repos doesn't show private repos (even if it's the user whose oauth access token you're using).

  • GETing /user/repos show private repos.

This isn't documented in the GitHub API docs at present, I just found out via testing.

Thanks to @ivanzuzak for suggesting to look at the endpoint.

like image 188
mikemaccana Avatar answered Nov 09 '22 07:11

mikemaccana