mirror of
https://github.com/actions/runner-images.git
synced 2025-12-15 14:17:22 +00:00
[Windows] Refactor helpers that verify hashsum and signature (#8886)
This commit is contained in:
committed by
GitHub
parent
abb81511d4
commit
92e22bd8c6
@@ -14,10 +14,9 @@ $null = New-Item -Path $destFilePath -ItemType Directory -Force
|
||||
$packagePath = Invoke-DownloadWithRetry -Url $kindDownloadLink -Path "$destFilePath\kind.exe"
|
||||
|
||||
#region Supply chain security - Kind
|
||||
$fileHash = (Get-FileHash -Path $packagePath -Algorithm SHA256).Hash
|
||||
$hashUrl = ($assets.browser_download_url -match "kind-windows-amd64.sha256sum") | Select-Object -First 1
|
||||
$externalHash = (Invoke-RestMethod -Uri $hashURL).ToString().Split("`n").Where({ $_ -ilike "*kind-windows-amd64*" }).Split(' ')[0]
|
||||
Use-ChecksumComparison $fileHash $externalHash
|
||||
Test-FileChecksum $packagePath -ExpectedSHA256Sum $externalHash
|
||||
#endregion
|
||||
|
||||
Add-MachinePathItem $destFilePath
|
||||
|
||||
Reference in New Issue
Block a user