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 committed Oct 24, 2024
1 parent 8138845 commit a19f025
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 @@ -49,6 +49,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 a19f025

Please sign in to comment.