mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
Update gh windows install script to use official release assets
This commit is contained in:
@@ -3,8 +3,15 @@
|
||||
## Desc: Install GitHub CLI
|
||||
################################################################################
|
||||
|
||||
Choco-Install -PackageName gh
|
||||
Write-Host "Get the latest gh version..."
|
||||
$GhReleasesJson = Invoke-RestMethod "https://api.github.com/repos/cli/cli/releases/latest"
|
||||
$WindowsMsiAssetNamePattern = "windows_amd64.msi"
|
||||
$WindowsMsiAsset = $GhReleasesJson.assets | Where-Object { $_.name.EndsWith($WindowsMsiAssetNamePattern) } | Select-Object -First 1
|
||||
$Name = $WindowsMsiAsset.name
|
||||
$DownloadUrl = $WindowsMsiAsset.browser_download_url
|
||||
|
||||
Install-Binary -Url $DownloadUrl -Name $Name
|
||||
|
||||
Add-MachinePathItem "C:\Program Files (x86)\GitHub CLI"
|
||||
|
||||
Invoke-PesterTests -TestFile "CLI.Tools" -TestName "GitHub CLI"
|
||||
Invoke-PesterTests -TestFile "CLI.Tools" -TestName "GitHub CLI"
|
||||
|
||||
Reference in New Issue
Block a user