@@ -2,6 +2,7 @@ const configuration = {
2
2
label_if_suspicious : false ,
3
3
comment_if_suspicious : false ,
4
4
close_if_suspicious : false ,
5
+ suspicious_criteria_tolerated : 0
5
6
} ;
6
7
7
8
async function make_information_report ( { user } ) {
@@ -150,19 +151,26 @@ module.exports = async ({ github, context, core }) => {
150
151
// then use a weights/factors instead of booleans,
151
152
// compute a confidence score to check against a threshold => if below, then reject
152
153
153
- async function processFailedChecks ( checks ) {
154
+ async function failedChecks ( checks ) {
154
155
const results = await Promise . all (
155
156
checks . map ( async ( check ) => ( {
156
157
check,
157
158
passed : await check . pass ( ) ,
158
159
} ) )
159
160
) ;
160
- return results . filter ( ( { passed } ) => passed ) . map ( ( { check } ) => check ) ;
161
+ return results
162
+ . filter ( ( { passed } ) => ! passed )
163
+ . map ( ( { check } ) => check ) ;
161
164
}
162
165
163
- processFailedChecks ( checks ) . then ( failed_checks => {
164
- const threshold = 0 ;
165
- if ( failed_checks . length <= threshold ) {
166
+ failedChecks ( checks ) . then ( failed_checks => {
167
+
168
+ console . log ( "Checks: " , {
169
+ passed : checks . length - failed_checks . length ,
170
+ failed : failed_checks . length
171
+ } )
172
+
173
+ if ( failed_checks . length <= configuration . suspicious_criteria_tolerated ) {
166
174
console . info ( "Not suspicious" ) ;
167
175
return ;
168
176
}
0 commit comments