@@ -129,7 +129,7 @@ sub github_release_with_exit_code {
129129
130130sub http_get {
131131 my $url = shift ;
132- my ($ok , $err , undef , $stdout ) = run(command => [qw{ curl -sf} , $url ]);
132+ my ($ok , $err , undef , $stdout , $stderr ) = run(command => [qw{ curl -sf} , $url ]);
133133 return {
134134 success => $ok ,
135135 content => join (' ' , @$stdout ),
@@ -247,7 +247,7 @@ sub merged_prs {
247247 say " Pull Requests: " . join (" , " , @pull_nums );
248248 my @releases ;
249249 for my $pull_num (@pull_nums ) {
250- my $url = sprintf " https://api.github.com/repos/%s /pulls/%d ?state=closed " , $REPO_NAME , $pull_num ;
250+ my $url = sprintf " https://api.github.com/repos/%s /pulls/%d " , $REPO_NAME , $pull_num ;
251251 my $res = http_get($url );
252252 unless ($res -> {success }) {
253253 warnf " request to $url failed\n " ;
@@ -403,7 +403,7 @@ sub create_pull_request {
403403 }
404404
405405 # return if last commit is updating specs and changelogs
406- my $last_commitlog = ` git log -1 -- oneline | cut -d ' ' -f2-` ;
406+ my $last_commitlog = ` git log -- oneline master..HEAD | cut -d ' ' -f2-` ;
407407 if ($last_commitlog =~ / update changelogs/ ){
408408 infof " skip to update changelogs because the last commit is 'update changelogs'.\n " ;
409409 return ;
@@ -418,10 +418,10 @@ sub create_pull_request {
418418 infof " skip to update changelogs because no merged pull request is found after the last release.\n "
419419 }
420420 if ($ret || git_with_exit_code qw/ diff --exit-code/ ){
421- git qw/ commit -am/ , " update changelogs" ;
422421 git qw/ config --global push.default matching/ ;
423422 git
qw/ config user.email/ ,
' [email protected] ' ;
424423 git qw/ config user.name/ , ' mackerel' ;
424+ git qw/ commit -am/ , " update changelogs" ;
425425 git qw/ push -u/ , " https://$ENV {GITHUB_TOKEN}\@ github.com/$REPO_NAME .git" ;
426426 infof " Difference is pushed to GitHub.\n " ;
427427 }
0 commit comments