@@ -79,18 +79,20 @@ pub(super) async fn parse_input(
79
79
}
80
80
}
81
81
82
- if let Some ( files) = & files {
83
- // This a PR.
84
-
85
- // Add the matching labels for the modified files paths
86
- if cfg
87
- . trigger_files
88
- . iter ( )
89
- . any ( |f| files. iter ( ) . any ( |file_diff| file_diff. path . starts_with ( f) ) )
90
- {
91
- autolabels. push ( Label {
92
- name : label. to_owned ( ) ,
93
- } ) ;
82
+ if event. issue . is_pr ( ) {
83
+ if let Some ( files) = & files {
84
+ // This a PR with modified files.
85
+
86
+ // Add the matching labels for the modified files paths
87
+ if cfg
88
+ . trigger_files
89
+ . iter ( )
90
+ . any ( |f| files. iter ( ) . any ( |file_diff| file_diff. path . starts_with ( f) ) )
91
+ {
92
+ autolabels. push ( Label {
93
+ name : label. to_owned ( ) ,
94
+ } ) ;
95
+ }
94
96
}
95
97
96
98
// Treat the following situations as a "new PR":
@@ -106,15 +108,12 @@ pub(super) async fn parse_input(
106
108
} ) ;
107
109
state. data . new_pr_labels_applied = true ;
108
110
}
109
- }
110
-
111
- if event. issue . pull_request . is_none ( )
112
- && cfg. new_issue
113
- && event. action == IssuesAction :: Opened
114
- {
115
- autolabels. push ( Label {
116
- name : label. to_owned ( ) ,
117
- } ) ;
111
+ } else {
112
+ if cfg. new_issue && event. action == IssuesAction :: Opened {
113
+ autolabels. push ( Label {
114
+ name : label. to_owned ( ) ,
115
+ } ) ;
116
+ }
118
117
}
119
118
}
120
119
0 commit comments