Skip to content

Commit e4e541d

Browse files
committed
Fix PowerShell string interpolation issues in GitHub Actions
- Remove problematic string interpolation characters that cause YAML parsing errors - Simplify output messages to avoid quote escaping issues - Store pipeline result in variable before foreach loop to prevent parsing conflicts
1 parent 5c7bb86 commit e4e541d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

.github/workflows/action.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,16 @@ jobs:
3838
$failedUrls = @()
3939
4040
# Test first 5 download URLs to avoid timeout
41-
$json.downloads | Select-Object -First 5 | ForEach-Object {
41+
$firstFive = $json.downloads | Select-Object -First 5
42+
foreach($item in $firstFive) {
4243
$testCount++
43-
Write-Host "Testing URL $testCount - $($_.url)"
44+
Write-Host "Testing URL $testCount"
4445
try {
45-
$response = Invoke-WebRequest -Uri $_.url -Method Head -UseBasicParsing -TimeoutSec 30
46-
Write-Host " $($_.file) - Status $($response.StatusCode)"
46+
$response = Invoke-WebRequest -Uri $item.url -Method Head -UseBasicParsing -TimeoutSec 30
47+
Write-Host "Success $($item.file) - Status $($response.StatusCode)"
4748
} catch {
48-
Write-Host " $($_.file) - Failed - $($_.Exception.Message)"
49-
$failedUrls += $_.url
49+
Write-Host "Failed $($item.file) - $($_.Exception.Message)"
50+
$failedUrls += $item.url
5051
}
5152
}
5253

0 commit comments

Comments
 (0)