mirror of
https://github.com/actions/stale.git
synced 2026-01-02 21:38:17 +00:00
Filter comments based on content, not author
This commit is contained in:
2
dist/index.js
vendored
2
dist/index.js
vendored
@@ -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;
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -2,4 +2,5 @@ import {IUser} from './user';
|
||||
|
||||
export interface IComment {
|
||||
user: IUser;
|
||||
body: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user