forked from ltb-project/self-service-password
-
Notifications
You must be signed in to change notification settings - Fork 0
/
github-issues-to-changelog.pl
41 lines (32 loc) · 973 Bytes
/
github-issues-to-changelog.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/perl
#
# Script to parse Github JSON API response and convert to changelog
# Usage: curl 'https://api.github.com/repos/ltb-project/self-service-password/issues?milestone=MILESTONE&state=all&direction=asc' | perl github-issues-to-changelog.pl
use JSON;
my $input;
while(<>) { $input .= "$_\n"; }
my $json = decode_json $input;
# Debian changelog
print "# Debian\n";
foreach my $issue (@$json) {
print " * gh#" . $issue->{number} .": " . $issue->{title} . "\n";
}
print "\n";
# RPM changelog
print "# RPM\n";
foreach my $issue (@$json) {
print "- gh#" . $issue->{number} .": " . $issue->{title} . "\n";
}
print "\n";
# GitHub changelog
print "# GitHub\n";
foreach my $issue (@$json) {
print "* #" . $issue->{number} .": " . $issue->{title} . "\n";
}
print "\n";
# Release contributors
print "# Contributors\n";
foreach my $issue (@$json) {
print "Author of issue #" . $issue->{number} .": " . $issue->{user}->{login} . "\n";
}
exit 0;