Skip to content

Commit d362adb

Browse files
committed
Make user repository search go through endpoint capable of reading private repositories
1 parent 89df625 commit d362adb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

bin/github-backup

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,9 +382,8 @@ def _request_url_error(template, retry_timeout):
382382
def retrieve_repositories(args):
383383
log_info('Retrieving repositories')
384384
single_request = False
385-
template = 'https://{0}/users/{1}/repos'.format(
386-
get_github_api_host(args),
387-
args.user)
385+
template = 'https://{0}/user/repos'.format(
386+
get_github_api_host(args))
388387
if args.organization:
389388
template = 'https://{0}/orgs/{1}/repos'.format(
390389
get_github_api_host(args),
@@ -402,6 +401,9 @@ def retrieve_repositories(args):
402401

403402
def filter_repositories(args, repositories):
404403
log_info('Filtering repositories')
404+
405+
repositories = [r for r in repositories if r['owner']['login'] == args.user]
406+
405407
name_regex = None
406408
if args.name_regex:
407409
name_regex = re.compile(args.name_regex)

0 commit comments

Comments
 (0)