From fd565e1edc27718b67d5fe77bf9ddaaaf4ea056a Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Sun, 14 Jun 2026 21:37:25 -0400 Subject: [PATCH] fix(ci): fix PowerShell parse error in Add Rust to PATH step Em dash in Write-Error string broke PowerShell string termination. Also try C:\Users\%USERNAME%\.cargo\bin as fallback since act may override USERPROFILE to a temp directory. Co-Authored-By: Claude Sonnet 4.6 --- .gitea/workflows/release.yml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index d1cf9fa..2fd3740 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -66,12 +66,21 @@ jobs: - name: Add Rust to PATH shell: powershell run: | - $cargoDir = "$env:USERPROFILE\.cargo\bin" - if (Test-Path $cargoDir) { - Add-Content -Path $env:GITHUB_PATH -Value $cargoDir - Write-Host "Added $cargoDir to GITHUB_PATH" - } else { - Write-Error "Rust not found at $cargoDir — install rustup on this runner first" + $candidates = @( + "$env:USERPROFILE\.cargo\bin", + "C:\Users\$env:USERNAME\.cargo\bin" + ) + $added = $false + foreach ($dir in $candidates) { + if (Test-Path "$dir\cargo.exe") { + Add-Content -Path $env:GITHUB_PATH -Value $dir + Write-Host "Added $dir to GITHUB_PATH" + $added = $true + break + } + } + if (-not $added) { + Write-Error "cargo.exe not found - install rustup on this runner" exit 1 }