Skip to content

Commit

Permalink
Merge pull request #1755 from jyn514/pr-edit
Browse files Browse the repository at this point in the history
don't try to reassign a reviewer when a pr title is edited
  • Loading branch information
ehuss authored Jan 25, 2024
2 parents 2dd37fa + 1ac30e8 commit 413f9d4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,17 @@ macro_rules! command_handlers {
errors: &mut Vec<HandlerError>,
) {
match event {
Event::Issue(e) => if !matches!(e.action, IssuesAction::Opened | IssuesAction::Edited) {
// always handle new PRs / issues
Event::Issue(IssuesEvent { action: IssuesAction::Opened, .. }) => {},
Event::Issue(IssuesEvent { action: IssuesAction::Edited, .. }) => {
// if the issue was edited, but we don't get a `changes[body]` diff, it means only the title was edited, not the body.
// don't process the same commands twice.
if event.comment_from().is_none() {
log::debug!("skipping title-only edit event");
return;
}
},
Event::Issue(e) => {
// no change in issue's body for these events, so skip
log::debug!("skipping event, issue was {:?}", e.action);
return;
Expand Down

0 comments on commit 413f9d4

Please sign in to comment.