Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't try to reassign a reviewer when a pr title is edited #1755

Merged
merged 1 commit into from
Jan 25, 2024
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
12 changes: 11 additions & 1 deletion src/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,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
Loading