-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check hash of downloaded setup #17
base: master
Are you sure you want to change the base?
Conversation
About the failures: they are expected since the SHA-512 of the downloaded setup is not the expected one: there's no |
Thanks. Yes, this seems like a sensible thing to do. As discussed in #9, it would also be nice if this whole thing was a bit more robust against transient problems... |
Well, not really, since that's not the hash of the file being served by cygwin.com. |
Which "expected" are you referring to? Accordingly to the docs, the SHA-512 of the current Current'y, it should be $ErrorActionPreference = 'Stop'
$local = New-TemporaryFile
try {
for ($i = 1; $i -le 10; $i++) {
Invoke-WebRequest -Uri https://cygwin.com/setup-x86_64.exe -OutFile $local
$hash = $(Get-FileHash -LiteralPath $local -Algorithm SHA512).Hash
Write-Host -Object "Cycle #$($i): $hash"
}
} finally {
Remove-Item -LiteralPath $local
} You'll have (for example):
And if we download the
|
cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e is the sha512 of the empty file (cf. |
I am also having this problem locally: see https://cygwin.com/pipermail/cygwin/2024-October/256604.html |
Since the installer and the signature file can be published at different times (see here), we may have false positives. So, I'd discard this pull request... |
I will be correcting the misinformation in that email, when I have a spare moment. |
It seems they are not recognized.. I don't know why, but who cares
They must be strings accordingly to the docs: see https://docs.github.com/en/actions/sharing-automations/creating-actions/metadata-syntax-for-github-actions#inputsinput_iddefault
I've updated this PR (a19f025) to check if the downloaded setup is empty |
What about checking the SHA-512 hash of the downloaded setup?
Reference: https://cygwin.com/install.html#hash