Fix an issue where the bot doesn't ignore its own comments (#73)

This commit is contained in:
Ross Brodbeck
2020-05-18 20:33:59 -04:00
committed by GitHub
parent 5ce6b77f2c
commit 96b682d29f
3 changed files with 43 additions and 5 deletions

View File

@@ -16,6 +16,7 @@ export interface Issue {
export interface User {
type: string;
login: string;
}
export interface Comment {
@@ -249,8 +250,14 @@ export class IssueProcessor {
// find any comments since the stale label
const comments = await this.listIssueComments(issue.number, sinceDate);
// if there are any user comments returned, issue is not stale anymore
return comments.filter(comment => comment.user.type === 'User').length > 0;
// if there are any user comments returned, and they were not by this bot, the issue is not stale anymore
return (
comments.filter(
comment =>
comment.user.type === 'User' &&
comment.user.login !== github.context.actor
).length > 0
);
}
// grab comments for an issue since a given date