Merge pull request #459 from Iamrodos/issue-93-starred-gists-warning

fix: warn and skip when --starred-gists used for different user
This commit is contained in:
Jose Diaz-Gonzalez
2025-12-03 23:07:29 -05:00
committed by GitHub
2 changed files with 18 additions and 10 deletions

View File

@@ -301,6 +301,8 @@ Starred gists vs starred repo behaviour
The starred normal repo cloning (``--all-starred``) argument stores starred repos separately to the users own repositories. However, using ``--starred-gists`` will store starred gists within the same directory as the users own gists ``--gists``. Also, all gist repo directory names are IDs not the gist's name.
Note: ``--starred-gists`` only retrieves starred gists for the authenticated user, not the target user, due to a GitHub API limitation.
Skip existing on incomplete backups
-----------------------------------

View File

@@ -1565,6 +1565,12 @@ def retrieve_repositories(args, authenticated_user):
repos.extend(gists)
if args.include_starred_gists:
if not authenticated_user.get("login") or args.user.lower() != authenticated_user["login"].lower():
logger.warning(
"Cannot retrieve starred gists for '%s'. GitHub only allows access to the authenticated user's starred gists.",
args.user,
)
else:
starred_gists_template = "https://{0}/gists/starred".format(
get_github_api_host(args)
)