mirror of
https://github.com/actions/runner-images.git
synced 2026-01-03 08:37:57 +08:00
[Windows] Refactor helpers that verify hashsum and signature (#8886)
This commit is contained in:
committed by
GitHub
parent
abb81511d4
commit
92e22bd8c6
@@ -12,10 +12,9 @@ $downloadUrl = ($assets.browser_download_url -ilike "*aliyun-cli-windows-*-amd64
|
||||
$packagePath = Invoke-DownloadWithRetry $downloadUrl
|
||||
|
||||
#region Supply chain security - Alibaba Cloud CLI
|
||||
$fileHash = (Get-FileHash -Path $packagePath -Algorithm SHA256).Hash
|
||||
$hashUrl = ($assets.browser_download_url -ilike "*SHASUMS256.txt*") | Select-Object -First 1
|
||||
$externalHash = (Invoke-RestMethod -Uri $hashURL).ToString().Split("`n").Where({ $_ -ilike "*$installerFileName*" }).Split(' ')[0]
|
||||
Use-ChecksumComparison $fileHash $externalHash
|
||||
Test-FileChecksum $packagePath -ExpectedSHA256Sum $externalHash
|
||||
#endregion
|
||||
|
||||
Write-Host "Expand aliyun-cli archive"
|
||||
|
||||
Reference in New Issue
Block a user