Skip to content

List forks for all users in an org #7975

@ncalteen

Description

@ncalteen

Describe the feature or problem you’d like to solve

I am working with a customer who would like to be able to list all forks for an organization (including any forks owned by the organization itself, as well as those owned by organization members). Originally, they were under the assumption the gh repo list <org> --fork command would list all forks of repositories in the organization (including those owned by users and the organization itself). This is not the case currently, but it would be helpful to be able to pull this information using the GitHub CLI.

As a workaround, I have provided the following:

gh api /repos/{owner}/{repo}/forks | jq -r '.[] | .full_name'

I can see where this would become confusing and potentially unwieldy, given that a user can be a member of any number of organizations. The original request was with regards to enterprise managed user (EMU) accounts, which have membership restricted to organization(s) in their enterprise. I wonder if it instead makes sense to investigate enterprise-specific commands for this type of scenario?

Proposed solution

Creation of CLI command(s) for enterprise administrators that allow them to list/query repositories and forks owned by all organizations and members within their enterprise.

Additional context

Add any other context like screenshots or mockups are helpful, if applicable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreThis issue is not accepting PRs from outside contributorsenhancementa request to improve CLIgh-reporelating to the gh repo command

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions