Last active
December 15, 2015 02:59
-
-
Save dogeared/5190834 to your computer and use it in GitHub Desktop.
Show who's assigned to which pull NOTE: you may have to install the json gem if you don't already have it. sudo gem install json
This file contains hidden or 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
#! /usr/bin/ruby | |
# | |
require 'rubygems' | |
require 'json' | |
require 'open-uri' | |
user = 'YOUR GITHUB USERNAME' | |
pass = 'YOUR GITHUB PASSWORD' | |
repo = 'workmarket/application' | |
results = {} | |
unassigned = [] | |
pulls = JSON.parse(open("https://api.github.com/repos/#{repo}/pulls", :http_basic_authentication => [user, pass]).read) | |
pulls.each do |pull| | |
issue = JSON.parse(open("https://api.github.com/repos/#{repo}/issues/#{pull['number']}", :http_basic_authentication => [user, pass]).read) | |
detail = "##{pull['number']} (created: #{pull['created_at']}, updated: #{pull['updated_at']}) - ('#{pull['title']}')" | |
if issue['assignee'].nil? | |
unassigned << detail | |
else | |
(results["#{issue['assignee']['login']}"] ||= []) << detail | |
end | |
end | |
puts 'unassigned' | |
unassigned.each do |result| | |
puts "\t#{result}" | |
end | |
results.each_key do |key| | |
puts key | |
results[key].each do |result| | |
puts "\t#{result}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment