Quick and dirty CSV report of a user/organisation's Github repos.
This simply creates a CSV based on the API response from Github. The values retrieved are specified in the HEADERS
array, and if you feel you would like to add any items to the list, you'll find the api documentation here
- ruby 2.3
- rubygems
- optparse
- highline/mport
- csv
Before you run this script you'll need to install optparse, highline and octokit:
gem install optparse
gem install highline
gem install octokit
Then save repo_info.rb
to your desktop and invoke.
Simply run the script using ruby, and be sure to oprovide the organisation/username param and the output file param:
ruby ./repo_info.rb --organisation my_org --output ~/Desktop/repos.csv # to retrieve a list of organisation repos
ruby ./repo_info.rb --username myname --output ~/Desktop/repos.csv # to retreive a list of user's repos
It will then prompt you for your github username and password:
$ Please enter your Github username
$ andrewbigger
$ Please enter your Github password
$ ************
And then it saves the CSV report to the nominated location. Easy.
Apparently Octokit works fine on Gitlab - although I have not tested this.