Skip to content

Can't see private repos in organization #1202

@nstein-gpjoule

Description

@nstein-gpjoule

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions