Skip to content

Commit a874096

Browse files
🪲 [Fix]: Fix coverage percent target handling when not provided (#32)
## Description This pull request includes a small change to the `scripts/init.ps1` file. The change ensures that the `CoveragePercentTarget` parameter is properly checked for null or empty values before being cast to a decimal. * [`scripts/init.ps1`](diffhunk://#diff-f47ceebe9ade2bb55cede031de8267e9c87b09336a93fcd557c02c1f488554b6L118-R119): Modified the assignment of `CoveragePercentTarget` to include a check for null or empty values before casting to a decimal. ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [x] 🪲 [Fix] - [ ] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas
1 parent 99bd1f5 commit a874096

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

scripts/init.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ LogGroup 'Init - Load configuration - Action overrides' {
115115
Path = $inputs.CodeCoverage_Path
116116
ExcludeTests = [string]::IsNullOrEmpty($inputs.CodeCoverage_ExcludeTests) ? $null : $inputs.CodeCoverage_ExcludeTests -eq 'true'
117117
RecursePaths = [string]::IsNullOrEmpty($inputs.CodeCoverage_RecursePaths) ? $null : $inputs.CodeCoverage_RecursePaths -eq 'true'
118-
CoveragePercentTarget = [decimal]$inputs.CodeCoverage_CoveragePercentTarget
118+
CoveragePercentTarget = [string]::IsNullOrEmpty($inputs.CodeCoverage_CoveragePercentTarget) ?
119+
$null : [decimal]$inputs.CodeCoverage_CoveragePercentTarget
119120
UseBreakpoints = [string]::IsNullOrEmpty($inputs.CodeCoverage_UseBreakpoints) ?
120121
$null : $inputs.CodeCoverage_UseBreakpoints -eq 'true'
121122
SingleHitBreakpoints = [string]::IsNullOrEmpty($inputs.CodeCoverage_SingleHitBreakpoints) ?

0 commit comments

Comments
 (0)