How can I get a list of all repositories in a GitHub organization where I am an admin or collaborator?

Viewed 239

I’m a member of the GitHub Organization bigOrg, with ~8000 repositories. I am a collaborator or an administrator for about 50 of them. My GitHub username is magnus. How can I query any of the GitHub APIs and retrieve a list of these ~50 repositories?

1 Answers

This doesn't answer the question I asked, but it might be close enough to solve my use case. This GraphQL query seems to return all repositories for which I am a collaborator or administrator but not an owner. Repositories owned by bigOrg are returned, but so are repositories owned by any other organization.

{
  viewer {
    repositories(first: 100, affiliations: [COLLABORATOR, ORGANIZATION_MEMBER]) {
      totalCount
      pageInfo {
        endCursor
        hasNextPage
      }
      nodes{
        url
        name
          owner {
            login
          }
        }
      }
   }
 }
Related