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
@@ -16,10 +16,9 @@ $DestinationPath = Join-Path $StackToolcachePath "x64"
|
||||
$StackArchivePath = Invoke-DownloadWithRetry $DownloadUrl
|
||||
|
||||
#region Supply chain security - Stack
|
||||
$fileHash = (Get-FileHash -Path $StackArchivePath -Algorithm SHA256).Hash
|
||||
$hashUrl = $StackReleasesJson.assets | Where-Object { $_.name.EndsWith("$DownloadFilePattern.sha256") } | Select-Object -ExpandProperty "browser_download_url" -First 1
|
||||
$externalHash = (Invoke-RestMethod -Uri $hashURL).ToString().Split("`n").Where({ $_ -ilike "*$DownloadFilePattern*" }).Split(' ')[0]
|
||||
Use-ChecksumComparison $fileHash $externalHash
|
||||
Test-FileChecksum $StackArchivePath -ExpectedSHA256Sum $externalHash
|
||||
#endregion
|
||||
|
||||
Write-Host "Expand stack archive"
|
||||
|
||||
Reference in New Issue
Block a user