christianspecht / scm-backup

Makes offline backups of your cloud hosted source code repositories
https://scm-backup.org/
GNU General Public License v3.0
59 stars 20 forks source link

Backing up GitHub private repos does not work #29

Closed christianspecht closed 5 years ago

christianspecht commented 5 years ago

GitHub Free now includes unlimited private repositories, but the Github API call that SCM Backup makes doesn't return the private test repo I created.

Apparently it's because of this: GET /users/:username/repos (which SCM Backup is using at the moment) only shows public repos, even when authenticated. To see private repos, we need to use GET /user/repos --> this means that we must authenticate with the user whose repos we want to backup. Authenticating with User A to backup User B (which works on Bitbucket) is not possible on GitHub!

christianspecht commented 5 years ago

GET /user/repos isn't enough, the scope is also important: our docs say repo:status, but this is not enough, the private repo is shown when setting the scope to repo .

christianspecht commented 5 years ago

--> this means that we must authenticate with the user whose repos we want to backup. Authenticating with User A to backup User B (which works on Bitbucket) is not possible on GitHub!

Correction: this doesn't work on Bitbucket either, so we should check this at runtime!

christianspecht commented 5 years ago

Does the API return the scope? If yes, display a warning if the scope is "too low" (so only public repos are shown)