Fix an issue where the bot doesn't ignore its own comments (#73)
This commit is contained in:
1 parent
5ce6b77f2c
commit
96b682d29f
3 files changed
+43
-5
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user