Skip to content

Can't see private repos in organization #1202

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

Open
nstein-gpjoule opened this issue Apr 8, 2025 · 3 comments
Open

Can't see private repos in organization #1202

nstein-gpjoule opened this issue Apr 8, 2025 · 3 comments

Comments

@nstein-gpjoule
Copy link

Hi,

I found a potential Bug, I'm co-owner of a github (non-enterprise) organization, but I'm unable to list our private repos. I'm able to list the public / forked repos, but not the private repos.

Since I'm a owner I would have thought that I'm able to list the repos:

Image

This is my code:

from getpass import getpass
import github3

user = "nstein-gpjoule"
org = "org"

def my_two_factor_function():
    return getpass("Enter 2FA code: ").strip() or my_two_factor_function()

token = github3.login(
    user,
    getpass(prompt="Enter Password: ").strip(),
    two_factor_callback=my_two_factor_function,
)
organization = token.organization(org)

But when querying for private repos I get a empty list:

[a for a in organization.repositories(type='private')]
[]

Environment:

$ python3 --version
Python 3.12.6
github3.py == 4.0.1
@sigmavirus24
Copy link
Owner

Can you share more information? There is no type parameter to that method:

@sigmavirus24
Copy link
Owner

Nevermind. The coffee hasn't kicked in. I grabbed the wrong methods. It's here

@sigmavirus24
Copy link
Owner

As far as I can tell, the implementation matches the API Documentation.

The only thing this makes me think is that you're not actually authenticated.

One thing you can do to verify is call token.me() and verify you get back github3.users.AuthenticatedUser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants