Skip to content

Commit 2cc1b04

Browse files
committed
Fix the issue with old pull requests
The problem is that it could not get information of an old pull request because the limit of list api was 100 and the result was sorted by created_at
1 parent f5e2c52 commit 2cc1b04

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/github-client.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ GithubClient.prototype.collectReleasePRs = function (releasePR) {
143143
return self.get(self.pullRequestEndpoint(), {
144144
state: 'closed',
145145
base: self.head,
146-
per_page: 100
146+
per_page: 100,
147+
sort: 'updated'
147148
}).then(function (res) {
148149
var prs = res.body
149150

test/github-client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ describe('GithubClient', function () {
140140
{ sha: '1' },
141141
{ sha: '2' }
142142
])
143-
.get('/repos/uiureo/awesome-app/pulls?state=closed&base=master&per_page=100')
143+
.get('/repos/uiureo/awesome-app/pulls?state=closed&base=master&per_page=100&sort=updated')
144144
.reply(200, [
145145
{ number: 10, head: { sha: '0' }, merged_at: null },
146146
{ number: 1, head: { sha: '1' }, merged_at: 'a' },

0 commit comments

Comments
 (0)