mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-10-02 23:53:26 +00:00
fix: filtering github bot comments (#587)
* fix: filtering gh bot comments * cr * cr * test empty commit * [skip ci] * [skip deploy]
This commit is contained in:
parent
1bb24ac7c8
commit
fb705d367a
2 changed files with 7 additions and 16 deletions
|
|
@ -381,11 +381,11 @@ export async function getIssueComments({
|
||||||
return comments;
|
return comments;
|
||||||
}
|
}
|
||||||
|
|
||||||
return comments.filter((comment) => {
|
return comments.filter(
|
||||||
return (
|
(comment) =>
|
||||||
comment.user?.type !== "Bot" || !comment.user?.name?.includes("[bot]")
|
comment.user?.type !== "Bot" &&
|
||||||
);
|
!comment.user?.login?.includes("[bot]"),
|
||||||
});
|
);
|
||||||
},
|
},
|
||||||
githubInstallationToken,
|
githubInstallationToken,
|
||||||
"Failed to get issue comments",
|
"Failed to get issue comments",
|
||||||
|
|
|
||||||
|
|
@ -93,17 +93,8 @@ export async function getMissingMessages(
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filter comments from the open swe bot
|
const untrackedCommentMessages = comments?.length
|
||||||
const filteredComments = comments?.filter(
|
? getUntrackedComments(input.messages, input.githubIssueId, comments)
|
||||||
(c) => c.user?.login.startsWith("open-swe") === false,
|
|
||||||
);
|
|
||||||
|
|
||||||
const untrackedCommentMessages = filteredComments?.length
|
|
||||||
? getUntrackedComments(
|
|
||||||
input.messages,
|
|
||||||
input.githubIssueId,
|
|
||||||
filteredComments,
|
|
||||||
)
|
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
return [...(issueMessage ? [issueMessage] : []), ...untrackedCommentMessages];
|
return [...(issueMessage ? [issueMessage] : []), ...untrackedCommentMessages];
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue