Justintime50 / github-archive

A powerful tool to concurrently clone, pull, or fork user and org repos and gists to create a GitHub archive.
MIT License
186 stars 48 forks source link

Will only pull org repos, gives error if user repos are used? #21

Closed 8465231 closed 3 years ago

8465231 commented 3 years ago

Ok, sorry to be such a pain, I am having issues getting the script to work with user repos included.

For example, trying to download openZFS and the associated personal repos with this command:

GITHUB_ARCHIVE_ORGS="openzfs, ahrens, gmelikov, grwilson, kusumi, prakashsurya" github-archive -uc -up -gc -gp -oc -op

Gives me this error:

`

GitHub Archive started...

Cloning personal repos...

Pulling personal repos...

Traceback (most recent call last): File "/usr/local/bin/github-archive", line 8, in sys.exit(main()) File "/usr/local/lib/python3.9/site-packages/github_archive/cli.py", line 83, in main CLI()._run() File "/usr/local/lib/python3.9/site-packages/github_archive/cli.py", line 71, in _run GithubArchive.run( File "/usr/local/lib/python3.9/site-packages/github_archive/archive.py", line 59, in run org_repos = GithubArchive.get_all_org_repos() File "/usr/local/lib/python3.9/site-packages/github_archive/archive.py", line 123, in get_all_org_repos all_org_repos.append(Github(GITHUB_TOKEN).get_organization(org.strip()).get_repos()) File "/usr/local/lib/python3.9/site-packages/github/MainClass.py", line 311, in get_organization headers, data = self.requester.requestJsonAndCheck("GET", "/orgs/" + login) File "/usr/local/lib/python3.9/site-packages/github/Requester.py", line 315, in requestJsonAndCheck return self.check( File "/usr/local/lib/python3.9/site-packages/github/Requester.py", line 340, in check raise self.createException(status, responseHeaders, output) github.GithubException.UnknownObjectException: 404 {"message": "Not Found", "documentation_url": "https://docs.github.com/rest/reference/orgs#get-an-organization"} `

If I only include the openzfs repo then it works fine. If I include multiple org repos it works fine. but if any user repos are included it fails.

How do I download the personal repos as well? Is there a separate variable for user repos?

Justintime50 commented 3 years ago

Correct, per #20, this feature still needs to be added. Orgs uses a different API endpoint than users which is why you are receiving an error. GitHub Archive currently only supports personal user repos and organization repos and does not allow someone to pull/clone other user repos. I can look into adding this feature but will track its progress on issue #20.