fix(ci): BOM-free GITHUB_OUTPUT + hardened artifact path on main

Runner fetches the composite action from @main. Propagates the fix
that stops an empty artifact-path output from globbing the F: drive.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Simone
2026-05-17 12:13:23 +02:00
parent fde084ed37
commit 719317ed91
+13 -5
View File
@@ -275,9 +275,17 @@ runs:
& $venvPython @pyArgs & $venvPython @pyArgs
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
# Emit outputs consumed by subsequent steps # Emit outputs consumed by subsequent steps.
"artifact-path=$artifactPath" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8 # PowerShell 5.1 `Out-File -Encoding utf8` writes a BOM; the act_runner
"artifact-name=$artifactName" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8 # GITHUB_OUTPUT parser then reads the key as "artifact-path" and
# the output resolves empty. An empty artifact-path made the upload
# step glob the entire F: drive. Write UTF-8 without BOM.
if (-not $artifactPath) { throw "artifactPath is empty; refusing to emit." }
$utf8NoBom = New-Object System.Text.UTF8Encoding($false)
[System.IO.File]::AppendAllText(
$env:GITHUB_OUTPUT, "artifact-path=$artifactPath`n", $utf8NoBom)
[System.IO.File]::AppendAllText(
$env:GITHUB_OUTPUT, "artifact-name=$artifactName`n", $utf8NoBom)
# ── Upload build artifacts on success ───────────────────────────────────── # ── Upload build artifacts on success ─────────────────────────────────────
- name: Upload artifacts - name: Upload artifacts
@@ -285,7 +293,7 @@ runs:
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: ${{ steps.invoke-ci.outputs.artifact-name }} name: ${{ steps.invoke-ci.outputs.artifact-name }}
path: ${{ steps.invoke-ci.outputs.artifact-path }}\ path: ${{ steps.invoke-ci.outputs.artifact-path }}
retention-days: ${{ inputs.artifact-retention-days }} retention-days: ${{ inputs.artifact-retention-days }}
if-no-files-found: error if-no-files-found: error
@@ -295,6 +303,6 @@ runs:
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: build-logs-${{ github.sha }} name: build-logs-${{ github.sha }}
path: ${{ steps.invoke-ci.outputs.artifact-path }}\*.log path: ${{ steps.invoke-ci.outputs.artifact-path }}/*.log
retention-days: 3 retention-days: 3
if-no-files-found: ignore if-no-files-found: ignore