Filter comments based on content, not author

This commit is contained in:
Luke Tomlinson
2021-06-24 16:50:23 -04:00
parent cce770077c
commit 75a803e008
3 changed files with 3 additions and 2 deletions

2
dist/index.js vendored
View File

@@ -626,7 +626,7 @@ class IssuesProcessor {
const comments = yield this.listIssueComments(issue.number, sinceDate); const comments = yield this.listIssueComments(issue.number, sinceDate);
core.debug(`The actor is: ${actor}`); core.debug(`The actor is: ${actor}`);
core.debug(`The comments are ${JSON.stringify(comments)}`); 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)}`); issueLogger.info(`Comments not made by actor or another bot: ${logger_service_1.LoggerService.cyan(filteredComments.length)}`);
// if there are any user comments returned // if there are any user comments returned
return filteredComments.length > 0; return filteredComments.length > 0;

View File

@@ -691,7 +691,7 @@ export class IssuesProcessor {
core.debug(`The actor is: ${actor}`) core.debug(`The actor is: ${actor}`)
core.debug(`The comments are ${JSON.stringify(comments)}`) core.debug(`The comments are ${JSON.stringify(comments)}`)
const filteredComments = comments.filter( 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( issueLogger.info(

View File

@@ -2,4 +2,5 @@ import {IUser} from './user';
export interface IComment { export interface IComment {
user: IUser; user: IUser;
body: string;
} }