From f959e655fa9a09dab98280d53de1cdf40332f49f Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 26 Mar 2025 11:18:30 +0100 Subject: [PATCH] retry network operations 3 times To avoid transient network or server issues. Fixes #9 --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 836d612..cb16534 100644 --- a/action.yml +++ b/action.yml @@ -52,13 +52,13 @@ runs: exit 1 } $setupFileName = "setup-$platform.exe" - Invoke-WebRequest "https://cygwin.com/$setupFileName" -OutFile C:\setup.exe + Invoke-WebRequest "https://cygwin.com/$setupFileName" -OutFile C:\setup.exe -MaximumRetryCount 3 if ((Get-Item -LiteralPath 'C:\setup.exe').Length -eq 0) { throw "The downloaded setup has a zero length!" } if ('${{ inputs.check-hash }}' -eq 'true') { - $expectedHashLines = $(Invoke-WebRequest -Uri https://cygwin.com/sha512.sum).ToString() -split "`n" + $expectedHashLines = $(Invoke-WebRequest -Uri https://cygwin.com/sha512.sum -MaximumRetryCount 3).ToString() -split "`n" $expectedHash = '' foreach ($expectedHashLine in $expectedHashLines) { if ($expectedHashLine.EndsWith(" $setupFileName")) {