diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index e5b2669..bcbebff 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -57,6 +57,15 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v5 + - name: Find PowerShell 7 on Windows runner + shell: powershell + run: | + $pwsh = (Get-Command pwsh -ErrorAction SilentlyContinue | Select-Object -First 1).Source + if (-not $pwsh) { $pwsh = Join-Path $env:ProgramFiles 'PowerShell\7\pwsh.exe' } + if (-not (Test-Path $pwsh)) { throw "PowerShell 7 is not available to the runner at $pwsh" } + $version = & $pwsh -NoProfile -Command '$PSVersionTable.PSVersion.ToString()' + Write-Host "Using PowerShell $version at $pwsh" + Add-Content -Path $env:GITEA_PATH -Value (Split-Path $pwsh) - name: Verify Windows runner shell: pwsh run: |