mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-24 10:28:10 +08:00
[Windows] Refactor helpers that verify hashsum and signature (#8886)
This commit is contained in:
committed by
GitHub
parent
abb81511d4
commit
92e22bd8c6
@@ -21,10 +21,9 @@ function Install-Msys2 {
|
||||
Write-Host "Finished download"
|
||||
|
||||
#region Supply chain security - Kind
|
||||
$fileHash = (Get-FileHash -Path $msys2File -Algorithm SHA256).Hash
|
||||
$hashUrl = ($assets.browser_download_url -match "msys2-checksums.txt") | Select-Object -First 1
|
||||
$externalHash = (Invoke-RestMethod -Uri $hashURL).ToString().Split("`n").Where({ $_ -ilike "*msys2-x86_64*" }).Split(' ')[0]
|
||||
Use-ChecksumComparison $fileHash $externalHash
|
||||
Test-FileChecksum $msys2File -ExpectedSHA256Sum $externalHash
|
||||
#endregion
|
||||
|
||||
# extract tar.xz to C:\
|
||||
|
||||
Reference in New Issue
Block a user