Skip to content
Permalink
Browse files

add script to list github pull request (assignments)

  • Loading branch information
jef-n committed Dec 6, 2013
1 parent 561f01c commit ac501831823a3f282d2b7ebcaa04fdace3bcf5f3
Showing with 30 additions and 0 deletions.
  1. +30 −0 scripts/listpulls.pl
@@ -0,0 +1,30 @@
#!/usr/bin/perl

use strict;
use warnings;

use JSON;
use LWP::UserAgent;

my $ua = LWP::UserAgent->new(ssl_opts => { verify_hostname => 0 });
my $res = $ua->get( "https://api.github.com/repos/qgis/qgis/pulls" );

die "pull request retrieval failed: " . $res->status_line unless $res->is_success;

my %assigned;

printf "%5s %-16s %s\n", "#", "Assignee", "Title";
foreach my $pull ( sort { $a->{number} <=> $b->{number} } @{ JSON::from_json( $res->decoded_content ) } ) {
my $assignee = $pull->{assignee}->{login};
$assignee = "" unless defined $assignee;

push @{ $assigned{$assignee} }, $pull->{number};

printf "%5d %-16s %s\n", $pull->{number}, $assignee || "", $pull->{title};
}

print "\nASSIGNMENTS:\n";

foreach my $assignee ( sort keys %assigned ) {
printf "%-22s %s\n", $assignee || "unassigned", join( ", ", sort @{ $assigned{$assignee} } );
}

0 comments on commit ac50183

Please sign in to comment.
You can’t perform that action at this time.