Last active
December 25, 2015 05:49
-
-
Save beydogan/6927650 to your computer and use it in GitHub Desktop.
Github API - get all files of commits from user's repos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
username = 'beydogan' | |
user_files = [] | |
user_repos = github.repos.list user: username | |
user_orgs = github.orgs.list user: username | |
user_repos.each do |repo| | |
name = repo.name | |
owner = repo.owner.login | |
commits = github.repos.commits.list owner, name, :author => username | |
commits_list.each do |commit| | |
commit_details = github.repos.commits.get owner, name, commit.sha | |
files = commit_details.files | |
user_files << files | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment