Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions src/handlers/backport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,20 @@ pub(super) async fn parse_input(
return Ok(None);
};

// Only handle events when the PR is opened or the first comment is edited
let should_check = matches!(event.action, IssuesAction::Opened | IssuesAction::Edited);
if !should_check || !event.issue.is_pr() {
// Only handle the event when the PR:
// - is opened (and not a draft)
// - is converted from draft to ready for review
// - when the first comment is edited
let skip_check = !matches!(
event.action,
IssuesAction::Opened | IssuesAction::Edited | IssuesAction::ReadyForReview
);
if skip_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);
}
Expand Down