Here's my query to the GitHub API
curl -i -u {user} https://api.github.com/orgs/{org}/repos?type=all
But this does not list all repos for this organization that I have access to. Specifically, it does not list repos in the organization that are part of a team that I am a member of.
If I were to query
curl -i -u {user} https://api.github.com/teams/{teamid}/repos
I would see the missing repos. If I were to navigate to github.com, I would see both private organization repos and my team repos next to each other on the same page. Is there a way to get all of these repos in the same API query?
You can use the github api for this. Hitting https://api.github.com/users/USERNAME/repos will list public repositories for the user USERNAME.
How To List All Public Repositories Belonging to a User? So, to list all public repos from a user, send a GET request to https://api.github.com/users/<USER-NAME>/repos , replacing with the actual user from whom you want to retrieve the repositories.
In the top right corner of GitHub.com, click your profile photo, then click Your organizations. Click the name of your organization. Under your organization name, click Teams.
In the top-right corner of GitHub Enterprise Server, click your profile photo, then click Enterprise settings. In the enterprise sidebar, click Policies. Under Policies, click Options. Under "Default organization membership visibility", use the drop-down menu, and click Private or Public.
You can use the below command
gh repo list {organization-name}
before this login with below command
gh auth login
github.com/cli/cli
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With