all repos — github-backup-script @ da780fd7e6f8a66298a6042cb8f85acc64163439

fix private repos
Marco Andronaco andronacomarco@gmail.com
Wed, 16 Aug 2023 16:24:36 +0200
commit

da780fd7e6f8a66298a6042cb8f85acc64163439

parent

3732a45d49f4d11f0ad60c4bb294aa458657d838

1 files changed, 3 insertions(+), 2 deletions(-)

jump to
M github_backup/__main__.pygithub_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)