File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -8,9 +8,16 @@ function run() {
8
8
const minCoverageInput = core . getInput ( 'min_coverage' ) ;
9
9
const excluded = core . getInput ( 'exclude' ) ;
10
10
const excludedFiles = excluded . split ( ' ' ) ;
11
- const minCoverage = parseMinCoverage ( minCoverageInput ) ;
11
+ const minCoverage = tryParseMinCoverage ( minCoverageInput ) ;
12
12
13
- if ( minCoverage === null || ! canParse ( lcovPath ) ) {
13
+ if ( minCoverage === null ) {
14
+ core . setFailed (
15
+ '❌ Failed to parse min_coverage. Make sure to enter a valid number between 0 and 100.' ,
16
+ ) ;
17
+ return ;
18
+ }
19
+
20
+ if ( ! canParse ( lcovPath ) ) {
14
21
return ;
15
22
}
16
23
@@ -108,17 +115,14 @@ you have no test files or your tests are not generating any coverage data.
108
115
return true ;
109
116
}
110
117
111
- function parseMinCoverage ( input ) {
118
+ function tryParseMinCoverage ( input ) {
112
119
if ( input === '' ) {
113
120
return 100 ;
114
121
}
115
122
116
123
const minCoverage = Number ( input ) ;
117
124
118
125
if ( isNaN ( minCoverage ) || minCoverage < 0 || minCoverage > 100 ) {
119
- core . setFailed (
120
- '❌ Failed to parse min_coverage. Make sure to enter a valid number between 0 and 100.' ,
121
- ) ;
122
126
return null ;
123
127
}
124
128
You can’t perform that action at this time.
0 commit comments