File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -47,16 +47,29 @@ impl Handler for AssignmentHandler {
47
47
} ;
48
48
49
49
if let Event :: Issue ( e) = event {
50
- if e. action != github:: IssuesAction :: Opened {
50
+ if ! matches ! ( e. action, github:: IssuesAction :: Opened | github :: IssuesAction :: Edited ) {
51
51
log:: debug!( "skipping event, issue was {:?}" , e. action) ;
52
- // skip events other than opening the issue to avoid retriggering commands in the
52
+ // skip events other than opening or editing the issue to avoid retriggering commands in the
53
53
// issue body
54
54
return Ok ( None ) ;
55
55
}
56
56
}
57
57
58
58
let mut input = Input :: new ( & body, & ctx. username ) ;
59
- match input. parse_command ( ) {
59
+ let command = input. parse_command ( ) ;
60
+
61
+ if let Some ( previous) = event. comment_from ( ) {
62
+ let mut prev_input = Input :: new ( & previous, & ctx. username ) ;
63
+ let prev_command = prev_input. parse_command ( ) ;
64
+ if command == prev_command {
65
+ log:: info!( "skipping unmodified command: {:?} -> {:?}" , prev_command, command) ;
66
+ return Ok ( None ) ;
67
+ } else {
68
+ log:: debug!( "executing modified command: {:?} -> {:?}" , prev_command, command) ;
69
+ }
70
+ }
71
+
72
+ match command {
60
73
Command :: Assign ( Ok ( command) ) => Ok ( Some ( command) ) ,
61
74
Command :: Assign ( Err ( err) ) => {
62
75
return Err ( format ! (
You can’t perform that action at this time.
0 commit comments