From 75a803e008da49d77a1ddce467de57628655c86e Mon Sep 17 00:00:00 2001 From: Luke Tomlinson Date: Thu, 24 Jun 2021 16:50:23 -0400 Subject: [PATCH] Filter comments based on content, not author --- dist/index.js | 2 +- src/classes/issues-processor.ts | 2 +- src/interfaces/comment.ts | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 61d9bdf5..88eadbe2 100644 --- a/dist/index.js +++ b/dist/index.js @@ -626,7 +626,7 @@ class IssuesProcessor { const comments = yield this.listIssueComments(issue.number, sinceDate); core.debug(`The actor is: ${actor}`); core.debug(`The comments are ${JSON.stringify(comments)}`); - const filteredComments = comments.filter(comment => comment.user.type === 'User' && comment.user.login !== actor); + const filteredComments = comments.filter(comment => comment.user.type === 'User' && comment.body !== IssuesProcessor._getStaleMessageUsedOptionName(issue)); issueLogger.info(`Comments not made by actor or another bot: ${logger_service_1.LoggerService.cyan(filteredComments.length)}`); // if there are any user comments returned return filteredComments.length > 0; diff --git a/src/classes/issues-processor.ts b/src/classes/issues-processor.ts index cc5a7b85..a44eab55 100644 --- a/src/classes/issues-processor.ts +++ b/src/classes/issues-processor.ts @@ -691,7 +691,7 @@ export class IssuesProcessor { core.debug(`The actor is: ${actor}`) core.debug(`The comments are ${JSON.stringify(comments)}`) const filteredComments = comments.filter( - comment => comment.user.type === 'User' && comment.user.login !== actor + comment => comment.user.type === 'User' && comment.body !== IssuesProcessor._getStaleMessageUsedOptionName(issue) ); issueLogger.info( diff --git a/src/interfaces/comment.ts b/src/interfaces/comment.ts index 33196f61..f6f96349 100644 --- a/src/interfaces/comment.ts +++ b/src/interfaces/comment.ts @@ -2,4 +2,5 @@ import {IUser} from './user'; export interface IComment { user: IUser; + body: string; }