Skip to content

Commit fb2c8c7

Browse files
author
multi-cli
committed
fix: make coverage baseline available
Fetch the pushed commit's parent for changed-line coverage and feed Pester subprocesses explicit UTF-8 bytes without a BOM so redirected secrets and confirmations remain exact on GitHub's Windows runner.
1 parent 4c5671a commit fb2c8c7

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ jobs:
204204
runs-on: ubuntu-latest
205205
steps:
206206
- uses: actions/checkout@v4
207+
with:
208+
fetch-depth: 2
207209
- name: Install coverage dependencies
208210
run: |
209211
BASHCOV_VERSION=3.3.0

‎tests/ProfileSafety.Tests.ps1‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,10 @@ function Invoke-ProfileLauncher {
2626
}.GetEnumerator()) { $startInfo.EnvironmentVariables[$entry.Key] = $entry.Value }
2727
$process = [System.Diagnostics.Process]::Start($startInfo)
2828
if ($null -ne $StdinText) {
29-
$inputWriter = New-Object IO.StreamWriter($process.StandardInput.BaseStream, (New-Object Text.UTF8Encoding($false)))
30-
$inputWriter.NewLine = "`n"
31-
$inputWriter.WriteLine($StdinText)
32-
$inputWriter.Close()
33-
} else {
34-
$process.StandardInput.Close()
29+
$inputBytes = (New-Object Text.UTF8Encoding($false)).GetBytes($StdinText + "`n")
30+
$process.StandardInput.BaseStream.Write($inputBytes, 0, $inputBytes.Length)
3531
}
32+
$process.StandardInput.Close()
3633
$stdoutTask = $process.StandardOutput.ReadToEndAsync()
3734
$stderrTask = $process.StandardError.ReadToEndAsync()
3835
$timedOut = -not $process.WaitForExit($TimeoutSeconds * 1000)

0 commit comments

Comments
 (0)