We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 19c4d14 commit 1da1032Copy full SHA for 1da1032
action.yml
@@ -67,7 +67,26 @@ runs:
67
68
$setupExe = "$vol\setup.exe"
69
$setupFileName = "setup-$platform.exe"
70
- Invoke-WebRequest "https://cygwin.com/$setupFileName" -OutFile $setupExe
+
71
+ $maxRetries = 3
72
+ $retryCount = 0
73
+ $success = $false
74
75
+ while (-not $success -and $retryCount -lt $maxRetries) {
76
+ try {
77
+ Invoke-WebRequest -Uri "https://cygwin.com/$setupFileName" -OutFile $setupExe
78
+ $success = $true
79
+ } catch {
80
+ Write-Output "Attempt $($retryCount + 1) failed. Retrying..."
81
+ Start-Sleep -Seconds 3
82
+ $retryCount++
83
+ }
84
85
86
+ if (-not $success) {
87
+ throw "Failed to download $setupFileName after $maxRetries attempts."
88
89
90
if ((Get-Item -LiteralPath $setupExe).Length -eq 0) {
91
throw "The downloaded setup has a zero length!"
92
}
0 commit comments