File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -218,7 +218,7 @@ export class Utils {
218
218
default :
219
219
throw operator ;
220
220
}
221
- return `.match(${ rhs } ${ flags } )${ remainingTokens } ${ _operator } null` ;
221
+ return `.match(${ rhs } ${ flags } )${ remainingTokens } ${ _operator } null ` ;
222
222
} ) ;
223
223
224
224
// Scenario when RHS is surrounded by double-quotes
@@ -250,8 +250,10 @@ Refer to https://docs.gitlab.com/ee/ci/jobs/job_rules.html#unexpected-behavior-f
250
250
} ) ;
251
251
252
252
// Convert all null.match functions to false
253
- evalStr = evalStr . replace ( / n u l l .m a t c h \( .+ ?\) ! = n u l l / g, "false" ) ;
254
- evalStr = evalStr . replace ( / n u l l .m a t c h \( .+ ?\) = = n u l l / g, "false" ) ;
253
+ evalStr = evalStr . replace ( / n u l l .m a t c h \( .+ ?\) \s * ! = \s * n u l l / g, "false" ) ;
254
+ evalStr = evalStr . replace ( / n u l l .m a t c h \( .+ ?\) \s * = = \s * n u l l / g, "false" ) ;
255
+
256
+ evalStr = evalStr . trim ( ) ;
255
257
256
258
let res ;
257
259
try {
Original file line number Diff line number Diff line change @@ -72,6 +72,11 @@ const tests = [
72
72
jsExpression : '"23".match(/1234/) != null' ,
73
73
evalResult : false ,
74
74
} ,
75
+ {
76
+ rule : '$CI_COMMIT_BRANCH && $GITLAB_FEATURES =~ /\bdependency_scanning\b/ && $CI_GITLAB_FIPS_MODE == "true"' ,
77
+ jsExpression : 'null && false && null == "true"' ,
78
+ evalResult : false ,
79
+ } ,
75
80
] ;
76
81
/* eslint-enable @typescript-eslint/quotes */
77
82
You can’t perform that action at this time.
0 commit comments