diff options
| author | git user <git@git.suspectdevices.com> | 2026-08-04 08:50:36 -0700 |
|---|---|---|
| committer | git user <git@git.suspectdevices.com> | 2026-08-04 08:50:36 -0700 |
| commit | efb9a486a0752384ce41be0840b003e65c87144f (patch) | |
| tree | 005fec0266c160f67dada485a94d4fcd9184cfb0 | |
| parent | 707d600d9ac4ac76b78654457f57a1e96b8b43fc (diff) | |
gather enough info to start a mirror
| -rwxr-xr-x | test.py | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -0,0 +1,25 @@ +#!/usr/bin/env python3 + +import os +from github import Github +from github import Auth +from dotenv import load_dotenv + +load_dotenv() + +auth_token = os.environ["AUTH_TOKEN"] + +def mygithub() : + auth = Auth.Token(auth_token) + g = Github(auth=auth) + return g + + +if __name__ == "__main__": + g = mygithub() + for repo in g.get_user().get_repos(): + #print(repo.name) + mypath="/srv/git/mirrors/github/"+repo.ssh_url.split(':')[1] + print("git clone --mirror " +repo.ssh_url+" "+mypath) + + g.close() |
