diff --git a/.gitea/actions/local-ci-build/action.yml b/.gitea/actions/local-ci-build/action.yml index ee11c31..d346f0f 100644 --- a/.gitea/actions/local-ci-build/action.yml +++ b/.gitea/actions/local-ci-build/action.yml @@ -275,9 +275,17 @@ runs: & $venvPython @pyArgs if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } - # Emit outputs consumed by subsequent steps - "artifact-path=$artifactPath" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8 - "artifact-name=$artifactName" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8 + # Emit outputs consumed by subsequent steps. + # PowerShell 5.1 `Out-File -Encoding utf8` writes a BOM; the act_runner + # 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 ───────────────────────────────────── - name: Upload artifacts @@ -285,7 +293,7 @@ runs: uses: actions/upload-artifact@v3 with: 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 }} if-no-files-found: error @@ -295,6 +303,6 @@ runs: uses: actions/upload-artifact@v3 with: name: build-logs-${{ github.sha }} - path: ${{ steps.invoke-ci.outputs.artifact-path }}\*.log + path: ${{ steps.invoke-ci.outputs.artifact-path }}/*.log retention-days: 3 if-no-files-found: ignore