mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
[Windows] Update functions that get urls and hashes from Github (#8917)
* [Windows] Update function to get hash from github * Remove redundant function and add documentation * Fix aws-sam-cli url
This commit is contained in:
committed by
GitHub
parent
eb0e4ff100
commit
d86c4900fa
@@ -5,12 +5,17 @@
|
||||
################################################################################
|
||||
|
||||
# Install the latest version of Git for Windows
|
||||
$repoURL = "https://api.github.com/repos/git-for-windows/git/releases/latest"
|
||||
$gitReleases = Invoke-RestMethod $repoURL
|
||||
$downloadUrl = $gitReleases.assets.browser_download_url -match "Git-.+-64-bit.exe" | Select-Object -First 1
|
||||
|
||||
$installerFile = Split-Path $downloadUrl -Leaf
|
||||
$externalHash = Get-HashFromGitHubReleaseBody -Url $RepoURL -FileName $installerFile
|
||||
$downloadUrl = Resolve-GithubReleaseAssetUrl `
|
||||
-Repo "git-for-windows/git" `
|
||||
-Version "latest" `
|
||||
-UrlMatchPattern "Git-*-64-bit.exe"
|
||||
|
||||
$externalHash = Get-GithubReleaseAssetHash `
|
||||
-Repo "git-for-windows/git" `
|
||||
-Version "latest" `
|
||||
-FileName (Split-Path $downloadUrl -Leaf) `
|
||||
-HashType "SHA256"
|
||||
|
||||
Install-Binary `
|
||||
-Url $downloadUrl `
|
||||
|
||||
Reference in New Issue
Block a user