Skip to content
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

Quick way to get all repo names of an org (or query repos based on regex directly) #2944

Open
joelostblom opened this issue Apr 6, 2024 · 0 comments

Comments

@joelostblom
Copy link

joelostblom commented Apr 6, 2024

Is there a way too either return only org repos matching a regex or quickly returning all the repo names (and then doing the regex match as a separate step)? Currently I have only found this approach:

repos = g.get_organization('org-name').get_repos()
[repo.name for repo in repos]

But that takes a prohibitively long time for large orgs due to it having to traverse all the repo end points in the API. I was hoping that there was a way to retrieve all the repo names with a single API call and then parsing that list before connecting only to the desired repos.

Running something like this from the command line is an order of magnitude faster, so I'm thinking there must be an end point in the API for getting all names directly (maybe this one?):

gh repo list org-name --json name --jq '.[].name' -L 99999  
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

1 participant