浏览代码

Don't post mentions for draft PRs.

Eric Huss 2 年之前
父节点
当前提交
ab24bf64f8
共有 2 个文件被更改,包括 5 次插入3 次删除
  1. 2 0
      src/github.rs
  2. 3 3
      src/handlers/mentions.rs

+ 2 - 0
src/github.rs

@@ -255,6 +255,8 @@ pub struct Issue {
     pub pull_request: Option<PullRequestDetails>,
     #[serde(default)]
     pub merged: bool,
+    #[serde(default)]
+    pub draft: bool,
     // API URL
     comments_url: String,
     #[serde(skip)]

+ 3 - 3
src/handlers/mentions.rs

@@ -37,13 +37,13 @@ pub(super) async fn parse_input(
 
     if !matches!(
         event.action,
-        IssuesAction::Opened | IssuesAction::Synchronize
+        IssuesAction::Opened | IssuesAction::Synchronize | IssuesAction::ReadyForReview
     ) {
         return Ok(None);
     }
 
-    // Don't ping on rollups.
-    if event.issue.title.starts_with("Rollup of") {
+    // Don't ping on rollups or draft PRs.
+    if event.issue.title.starts_with("Rollup of") || event.issue.draft {
         return Ok(None);
     }