From 68de8c8f99209959339d468ab8e9f26a5b912033 Mon Sep 17 00:00:00 2001 From: apiraino Date: Tue, 2 Sep 2025 09:07:51 +0200 Subject: [PATCH] Exclude drafts from auto-backport nominate --- src/handlers/backport.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/handlers/backport.rs b/src/handlers/backport.rs index 51a2bd4d..09db53be 100644 --- a/src/handlers/backport.rs +++ b/src/handlers/backport.rs @@ -50,13 +50,14 @@ pub(super) async fn parse_input( None => return Ok(None), }; - // Only handle events when the PR is opened or the first comment is edited + // Only handle events when the PR is opened (and it's not a draft) or when the first comment is edited let should_check = matches!(event.action, IssuesAction::Opened | IssuesAction::Edited); - if !should_check || !event.issue.is_pr() { + if !should_check || !event.issue.is_pr() || event.issue.draft { log::debug!( - "Skipping backport event because: IssuesAction = {:?} issue.is_pr() {}", + "Skipping backport event because: IssuesAction = {:?}, issue.is_pr() {}, draft = {}", event.action, - event.issue.is_pr() + event.issue.is_pr(), + event.issue.draft ); return Ok(None); }