mirror of
https://github.com/actions/runner-images.git
synced 2025-12-13 20:56:47 +00:00
* Use Resolve-GithubReleaseAssetUrl more widely * Add the Get-ChecksumFromUrl function * Sort exported functions and add docs * Remove alias and fix typo * Fix kind checksum url and syntax * Fix checksums url for gh cli and msys2 * [Windows] Cleanup various scripts * Add spaces after type specifications * Rename the Take-Part function
23 lines
985 B
PowerShell
23 lines
985 B
PowerShell
################################################################################
|
|
## File: Install-Docker-WinCred.ps1
|
|
## Desc: Install Docker credential helper.
|
|
## Supply chain security: checksum validation
|
|
################################################################################
|
|
|
|
Write-Host "Install docker-wincred"
|
|
$downloadUrl = Resolve-GithubReleaseAssetUrl `
|
|
-Repo "docker/docker-credential-helpers" `
|
|
-Version "latest" `
|
|
-UrlMatchPattern "docker-credential-wincred-*amd64.exe"
|
|
$binaryPath = Invoke-DownloadWithRetry -Url $downloadUrl -Path "C:\Windows\System32\docker-credential-wincred.exe"
|
|
|
|
#region Supply chain security
|
|
$binaryName = Split-Path $downloadUrl -Leaf
|
|
$externalHash = Get-ChecksumFromUrl -Type "SHA256" `
|
|
-Url ($downloadUrl -replace $binaryName, "checksums.txt") `
|
|
-FileName $binaryName
|
|
Test-FileChecksum -Path $binaryPath -ExpectedSHA256Sum $externalHash
|
|
#endregion
|
|
|
|
Invoke-PesterTests -TestFile "Docker" -TestName "DockerWinCred"
|