diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bbd934..da5a71a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). on GitHub API clients. - Setting GitHub access tokens with `--access-tokens` command option resulted in an error. + - Analyze command did not collect private repositories from organizations. ## [1.0.0] ### Added diff --git a/lib/gitrob/github/data_manager.rb b/lib/gitrob/github/data_manager.rb index 34e982c..d33fc4b 100644 --- a/lib/gitrob/github/data_manager.rb +++ b/lib/gitrob/github/data_manager.rb @@ -82,9 +82,15 @@ module Gitrob end def get_repositories(owner) - github_client do |client| - client.repos.list( - :user => owner["login"]).reject { |r| r["fork"] } + if owner["type"] == "Organization" + github_client do |client| + client.repos.list(:org => owner["login"], :type => "sources") + end + else + github_client do |client| + client.repos.list( + :user => owner["login"]).reject { |r| r["fork"] } + end end end