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 ment
To access private information, you need to include the access_token parameter in the URL . Example:
/users/someusername/repos?access_token=512295a0afb73bdd1c076a00c69f8abcd12345
Access tokens are generated per user. You can generate your personal access token here:
https://github.com/settings/applications
You also need to have permission on the private repository to be able to see information about it. You can also see information about the forks of the private repository that you have access to.
Screenshot
https://api.github.com/user/repos?access_token=#################################
this url gives all the public and private repositories, To get the token use this
link https://github.com/settings/tokens
Make sure you mark all the ticks given in the scope section
(I'm a newbie with Git and was using the command line following https://developer.github.com/guides/getting-started/ but I had trouble with quoting etc. So I switched to using a browser and made some progress)
In the browser my url is
https://api.github.com/user/repos?access_token=deadbeefdeadbeefdeadbeefdeadbeefdeadbeef
where I have swapped in fake token for my real one (tokens should be treated like passwords are not shared).
This gave me complete list of my private repositories in JSON.
For any Octokit users having this problem: client.list_repos(nil)
found here will use GET /user/repos
which returns private repos too.
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.