-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow mirroring private org repositories #19
base: main
Are you sure you want to change the base?
Allow mirroring private org repositories #19
Conversation
The /users/{username}/repos endpoint does not return private org repositories. The /search/repositories endpoint has to be used instead. Related: https://github.com/orgs/community/discussions/24382
It is important to mention, that a new env variable is used: "GITHUB_ORG" instead of "GITHUB_USERNAME". |
(not a maintainer, just a lurker) |
Hey 👋 First of all thank your very much for your contribution! Is there any specific reason we could not use the current environment variable and determine if the configured username is an org or user? A call to the user lookup by id should reveal whether the configured user is an organisation or a regular github user, so we could use this to adjust the behavior. |
bd59105
to
bec14fb
Compare
Thanks for the hint, I just pushed some changes to use this approach. The code now also supports PS: |
Thanks for your contribution 🙏 |
I just had a look at he proposed changes. They look perfectly fine. Sadly the complexity of the method to get the repositories in addition with current pending changes seem to increase radically. Due to that, I would love to do a refactoring and add tests for this particular part of the tool. Otherwise future requirements are likely to break existing functionality and I know that some people are using that in production. If you are fine with that, I would love to use your proposed changes as blueprint to build the functionality test-driven after the refactoring. Does that sound fine to you? |
That makes sense
Sure, go ahead 🙂 |
The
/users/{username}/repos
endpoint does not return private org repositories.The
/search/repositories
endpoint has to be used instead.Related: https://github.com/orgs/community/discussions/24382