Skip to content

Commit 4653539

Browse files
committed
Fix PR comment upsert to match on marker text only
1 parent 2d54ec5 commit 4653539

1 file changed

Lines changed: 1 addition & 13 deletions

File tree

data/pr-check/src/main.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,6 @@ struct Contributor {
5959
struct IssueComment {
6060
id: u64,
6161
body: String,
62-
user: CommentUser,
63-
}
64-
65-
/// The author of a comment.
66-
#[derive(Debug, Deserialize)]
67-
struct CommentUser {
68-
login: String,
69-
#[serde(rename = "type")]
70-
account_type: String,
7162
}
7263

7364
// ---------------------------------------------------------------------------
@@ -473,10 +464,7 @@ async fn upsert_comment(
473464
) -> Result<()> {
474465
let comments = client.list_pr_comments(repo, pr).await?;
475466

476-
let existing = comments.iter().find(|c| {
477-
(c.user.account_type == "Bot" || c.user.login.ends_with("[bot]") || c.user.login == "github-actions[bot]")
478-
&& c.body.contains(COMMENT_MARKER)
479-
});
467+
let existing = comments.iter().find(|c| c.body.contains(COMMENT_MARKER));
480468

481469
match existing {
482470
Some(c) => client.update_pr_comment(repo, c.id, body).await,

0 commit comments

Comments
 (0)