Skip to content

Commit 0964127

Browse files
Round coverage percentages to two decimal places for improved readability in main.ps1
1 parent dd7da3d commit 0964127

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/main.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ foreach ($file in $files) {
4848
$jsonContent = Get-Content -Path $file.FullName -Raw | ConvertFrom-Json
4949

5050
[pscustomobject]@{
51-
Coverage = "$($jsonContent.CoveragePercent)% / $($jsonContent.CoveragePercentTarget)%"
51+
Coverage = "$([Math]::Round($jsonContent.CoveragePercent, 2))%"
52+
Target = "$([Math]::Round($jsonContent.CoveragePercentTarget, 2))%"
5253
Analyzed = "$($jsonContent.CommandsAnalyzedCount) commands"
5354
Executed = "$($jsonContent.CommandsExecutedCount) commands"
5455
Missed = "$($jsonContent.CommandsMissedCount) commands"
@@ -135,7 +136,8 @@ $codeCoverage = [PSCustomObject]@{
135136

136137
# Print stats:
137138
$stats = [pscustomobject]@{
138-
Coverage = "$($codeCoverage.CoveragePercent)% / $($codeCoverage.CoveragePercentTarget)%"
139+
Coverage = "$([Math]::Round($codeCoverage.CoveragePercent, 2))%"
140+
Target = "$([Math]::Round($codeCoverage.CoveragePercentTarget, 2))%"
139141
Analyzed = "$($codeCoverage.CommandsAnalyzedCount) commands"
140142
Executed = "$($codeCoverage.CommandsExecutedCount) commands"
141143
Missed = "$($codeCoverage.CommandsMissedCount) commands"
@@ -290,7 +292,6 @@ LogGroup 'Set step summary' {
290292
}
291293

292294
Set-GitHubStepSummary -Summary $markdown
293-
$markdown
294295
}
295296

296297

0 commit comments

Comments
 (0)