瀏覽代碼

Avoid generating pings on comment edits

Mark Rousskov 5 年之前
父節點
當前提交
b2b866a875
共有 1 個文件被更改,包括 14 次插入5 次删除
  1. 14 5
      src/handlers/ping.rs

+ 14 - 5
src/handlers/ping.rs

@@ -28,11 +28,20 @@ impl Handler for PingHandler {
             return Ok(None);
         };
 
-        if let Event::Issue(e) = event {
-            if e.action != github::IssuesAction::Opened {
-                // skip events other than opening the issue to avoid retriggering commands in the
-                // issue body
-                return Ok(None);
+        match event {
+            Event::Issue(e) => {
+                if e.action != github::IssuesAction::Opened {
+                    // skip events other than opening the issue to avoid retriggering commands in the
+                    // issue body
+                    return Ok(None);
+                }
+            }
+            Event::IssueComment(e) => {
+                // Especially on ping commands, which ping tons of folks, this
+                // is quite noisy.
+                if e.action != github::IssueCommentAction::Created {
+                    return Ok(None);
+                }
             }
         }