Skip to content

Commit

Permalink
Merge pull request #925 from qtomlinson/qt/sync_curation
Browse files Browse the repository at this point in the history
Retrieve closed pull requests from oldest to newest during syncAllContributions
  • Loading branch information
nellshamrell authored Feb 16, 2022
2 parents 81df6ab + 785f9c8 commit ee816ba
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions providers/curation/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,15 @@ class GitHubCurationService {
async syncAllContributions(client) {
const states = ['open', 'closed']
for (let state of states) {
let response = await client.pullRequests.getAll({
let prOptions = {
owner: this.options.owner,
repo: this.options.repo,
per_page: 100,
state
})
}
//See https://docs.github.com/en/rest/reference/pulls#list-pull-requests
if (state === 'closed') prOptions = { ...prOptions, sort: 'updated', direction: 'asc' }
let response = await client.pullRequests.getAll(prOptions)
this._processContributions(response.data)
while (this.github.hasNextPage(response)) {
response = await this.github.getNextPage(response)
Expand Down

0 comments on commit ee816ba

Please sign in to comment.