Skip to content

Commit

Permalink
Throw an exception if the downloaded setup is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
mlocati authored and jon-turney committed Jan 5, 2025
1 parent a39f501 commit 2fea0d7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ runs:
}
$setupFileName = "setup-$platform.exe"
Invoke-WebRequest "https://cygwin.com/$setupFileName" -OutFile C:\setup.exe
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"
Expand Down

0 comments on commit 2fea0d7

Please sign in to comment.