mirror of
https://github.com/actions/stale.git
synced 2025-12-11 12:37:27 +00:00
Fix an issue where the bot doesn't ignore its own comments (#73)
This commit is contained in:
@@ -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