fix private repos
Marco Andronaco andronacomarco@gmail.com
Wed, 16 Aug 2023 16:24:36 +0200
1 files changed,
3 insertions(+),
2 deletions(-)
jump to
M
github_backup/__main__.py
→
github_backup/__main__.py
@@ -31,13 +31,14 @@ def handle_repo(r):
repo_name = r.name repo_path = Path(join(repo_dir, repo_name + ".git")) if repo_path.exists(): + return logger.info("Updating " + repo_name) repo = Repo(repo_path) repo.remote().fetch("+refs/heads/*:refs/heads/*") return repo - url = f"https://{github_user}:{github_token}@github.com/{github_user}/{repo_name}.git" + url = f"https://{github_user}:{github_token}@github.com/{r.owner.login}/{repo_name}.git" logger.info("Cloning " + repo_name) return Repo.clone_from(url, repo_path, bare=True) results = [ handle_repo(repo) for repo in repos if repo.name not in blacklist ] -logger.info(results)+logger.info(results)