List of Repos (Public and Private) for an Organization on Github
github, github-api, ruby-on-rails
Solution
Are you able to fetch the info using plain curl? E.g. try:
curl -u "your_username" https://api.github.com/orgs/:your_organization/repos?type=private
(this should list only private repos, substitute `private` with `all` to list all repos, as per the API docs: http://developer.github.com/v3/repos/#list-organization-repositories).
If this works, then you are just having trouble making it work using the ruby library?
If you don't know which organizations a user belongs to, use this API to find out: http://developer.github.com/v3/orgs/#list-user-organizations
Problem
I am trying to get a list of all repos associated with an organization using the github api gem in my rails application. I use omniauth to authenticate a user and then I am able to access a list of their organizations as well as a list of the user's repos but I am trying to get a list of repos for the user's organizations (which they have administrative access to). There was one question on stackoverflow that seemed hopeful and it answered my question for accessing info for an organization's repo that I already have the name of but what about repos that I don't have a name for? Any ideas how to list all repos for an org using the github api gem?