mirror of
https://github.com/michenriksen/gitrob.git
synced 2026-01-02 03:39:31 -06:00
Fix bug causing private organization repositories to not be collected
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user