File tree Expand file tree Collapse file tree 1 file changed +25
-16
lines changed Expand file tree Collapse file tree 1 file changed +25
-16
lines changed Original file line number Diff line number Diff line change @@ -26,23 +26,32 @@ pub(super) async fn parse_input(
2626 // FIXME: This will re-apply labels after a push that the user had tried to
2727 // remove. Not much can be done about that currently; the before/after on
2828 // synchronize may be straddling a rebase, which will break diff generation.
29- if matches ! (
29+ let can_trigger_files = matches ! (
3030 event. action,
31- IssuesAction :: Opened
32- | IssuesAction :: Closed
33- | IssuesAction :: Reopened
34- | IssuesAction :: Synchronize
35- | IssuesAction :: ReadyForReview
36- | IssuesAction :: ConvertedToDraft
37- ) {
38- let files = event
39- . issue
40- . diff ( & ctx. github )
41- . await
42- . map_err ( |e| {
43- log:: error!( "failed to fetch diff: {:?}" , e) ;
44- } )
45- . unwrap_or_default ( ) ;
31+ IssuesAction :: Opened | IssuesAction :: Synchronize
32+ ) ;
33+
34+ if can_trigger_files
35+ || matches ! (
36+ event. action,
37+ IssuesAction :: Closed
38+ | IssuesAction :: Reopened
39+ | IssuesAction :: ReadyForReview
40+ | IssuesAction :: ConvertedToDraft
41+ )
42+ {
43+ let files = if can_trigger_files {
44+ event
45+ . issue
46+ . diff ( & ctx. github )
47+ . await
48+ . map_err ( |e| {
49+ log:: error!( "failed to fetch diff: {:?}" , e) ;
50+ } )
51+ . unwrap_or_default ( )
52+ } else {
53+ Default :: default ( )
54+ } ;
4655
4756 let mut autolabels = Vec :: new ( ) ;
4857 let mut to_remove = Vec :: new ( ) ;
You can’t perform that action at this time.
0 commit comments