Skip to content

Commit 7819923

Browse files
authored
Merge pull request #2396 from Kobzol/comment-edited
Do not react to comment edits
2 parents 245dbac + 970e91c commit 7819923

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

site/src/api.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,11 @@ pub mod github {
602602
#[derive(Debug, Clone, Serialize, Deserialize)]
603603
#[serde(untagged)]
604604
pub enum Request {
605-
Issue { issue: Issue, comment: Comment },
605+
Issue {
606+
action: String,
607+
issue: Issue,
608+
comment: Comment,
609+
},
606610
Push(Push),
607611
}
608612

site/src/request_handlers/github.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,17 @@ pub async fn handle_github_webhook(
1919
) -> ServerResult<github::Response> {
2020
log::info!("handle_github({:?})", request);
2121
match request {
22-
github::Request::Issue { issue, comment } => handle_issue(ctxt, issue, comment).await,
22+
github::Request::Issue {
23+
action,
24+
issue,
25+
comment,
26+
} => {
27+
// Ignore edits and other comment actions
28+
if action != "created" {
29+
return Ok(github::Response);
30+
}
31+
handle_issue(ctxt, issue, comment).await
32+
}
2333
github::Request::Push(p) => handle_push(ctxt, p).await,
2434
}
2535
}

0 commit comments

Comments
 (0)