File tree Expand file tree Collapse file tree 2 files changed +17
-7
lines changed Expand file tree Collapse file tree 2 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,9 @@ export class CronHandler {
61
61
[ issueConfig . label_needs_info ]
62
62
) ;
63
63
64
+ log . debug (
65
+ `preProcessIssues: ${ needsInfoIssues . length } issues witth label ${ issueConfig . label_needs_info } `
66
+ ) ;
64
67
for ( const issue of needsInfoIssues ) {
65
68
const issueActions = await this . doubleCheckNeedsInfo (
66
69
org ,
@@ -290,6 +293,11 @@ export class CronHandler {
290
293
let comments = await this . gh_client . getCommentsForIssue ( org , name , number ) ;
291
294
comments = comments . sort ( util . compareTimestamps ) . reverse ( ) ;
292
295
296
+ if ( ! comments || comments . length === 0 ) {
297
+ console . log ( `Issue ${ name } #${ number } has no comments.` ) ;
298
+ return actions ;
299
+ }
300
+
293
301
// When the issue was marked stale, the bot will have left a comment with certain metadata
294
302
const markStaleComment = comments . find ( comment => {
295
303
return comment . body . includes ( EVT_MARK_STALE ) ;
Original file line number Diff line number Diff line change @@ -177,15 +177,17 @@ export class GitHubClient {
177
177
state ?: IssueState ,
178
178
labels ?: string [ ]
179
179
) {
180
- const stateFilter = state || "all" ;
181
- const labelsFilter = labels === undefined ? undefined : labels . join ( "," ) ;
182
-
183
- return paginate ( this . api . issues . listForRepo , {
180
+ const opts : any = {
184
181
owner,
185
182
repo,
186
- state : stateFilter ,
187
- labels : labelsFilter
188
- } ) ;
183
+ state : state || "all"
184
+ } ;
185
+
186
+ if ( labels && labels . length > 0 ) {
187
+ opts . labels = labels . join ( "," ) ;
188
+ }
189
+
190
+ return paginate ( this . api . issues . listForRepo , opts ) ;
189
191
}
190
192
191
193
/**
You can’t perform that action at this time.
0 commit comments