Commit 8726cf5 1 parent 75b0730 commit 8726cf5 Copy full SHA for 8726cf5
File tree 1 file changed +21
-10
lines changed
1 file changed +21
-10
lines changed Original file line number Diff line number Diff line change @@ -111,11 +111,17 @@ const prHelpers = robot => {
111
111
}
112
112
113
113
const getComments = async pr => {
114
- return new Promise ( resolve => {
115
- github . get ( `${ pr . issue_url } /comments` , res => {
116
- resolve ( res )
117
- } )
118
- } )
114
+ const comments = [ ]
115
+ let nOnPage = 30
116
+ let page = 1
117
+ while ( nOnPage === 30 ) {
118
+ const res = await ghget ( `${ pr . url } /comments?per_page=${ nOnPage } &page=${ page } ` )
119
+ nOnPage = res . length
120
+ page += 1
121
+ comments . push ( ...res )
122
+ }
123
+ return comments
124
+
119
125
}
120
126
121
127
const isReviewOld = ( reviewRequestedTimeStamp , threshold ) => {
@@ -171,11 +177,16 @@ const prHelpers = robot => {
171
177
}
172
178
173
179
const getPRCommits = async pr => {
174
- return new Promise ( resolve => {
175
- github . get ( `${ pr . url } /commits` , res => {
176
- resolve ( res )
177
- } )
178
- } )
180
+ const commits = [ ]
181
+ let nOnPage = 30
182
+ let page = 1
183
+ while ( nOnPage === 30 ) {
184
+ const res = await ghget ( `${ pr . url } /commits?per_page=${ nOnPage } &page=${ page } ` )
185
+ nOnPage = res . length
186
+ page += 1
187
+ commits . push ( ...res )
188
+ }
189
+ return commits
179
190
}
180
191
181
192
return {
You can’t perform that action at this time.
0 commit comments