Skip to content

Commit ac50183

Browse files
committed
add script to list github pull request (assignments)
1 parent 561f01c commit ac50183

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

scripts/listpulls.pl

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/perl
2+
3+
use strict;
4+
use warnings;
5+
6+
use JSON;
7+
use LWP::UserAgent;
8+
9+
my $ua = LWP::UserAgent->new(ssl_opts => { verify_hostname => 0 });
10+
my $res = $ua->get( "https://api.github.com/repos/qgis/qgis/pulls" );
11+
12+
die "pull request retrieval failed: " . $res->status_line unless $res->is_success;
13+
14+
my %assigned;
15+
16+
printf "%5s %-16s %s\n", "#", "Assignee", "Title";
17+
foreach my $pull ( sort { $a->{number} <=> $b->{number} } @{ JSON::from_json( $res->decoded_content ) } ) {
18+
my $assignee = $pull->{assignee}->{login};
19+
$assignee = "" unless defined $assignee;
20+
21+
push @{ $assigned{$assignee} }, $pull->{number};
22+
23+
printf "%5d %-16s %s\n", $pull->{number}, $assignee || "", $pull->{title};
24+
}
25+
26+
print "\nASSIGNMENTS:\n";
27+
28+
foreach my $assignee ( sort keys %assigned ) {
29+
printf "%-22s %s\n", $assignee || "unassigned", join( ", ", sort @{ $assigned{$assignee} } );
30+
}

0 commit comments

Comments
 (0)