mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-18 07:46:45 +00:00
Fix Git installer to download directly from release (#718)
* Install Git for Windows directly from official release rather than Chocolatey.
This commit is contained in:
@@ -5,9 +5,33 @@
|
||||
|
||||
Import-Module -Name ImageHelpers
|
||||
|
||||
# Install the latest version of Git which is bundled with Git LFS.
|
||||
# See https://chocolatey.org/packages/git
|
||||
choco install git -y --package-parameters="/GitAndUnixToolsOnPath /WindowsTerminal /NoShellIntegration"
|
||||
function getSimpleValue([string] $url, [string] $filename ) {
|
||||
$fullpath = "${env:Temp}\$filename"
|
||||
Invoke-WebRequest -Uri $url -OutFile $fullpath
|
||||
$value = Get-Content $fullpath -Raw
|
||||
|
||||
return $value
|
||||
}
|
||||
|
||||
# Install the latest version of Git for Windows
|
||||
$gitTag = getSimpleValue -url "https://gitforwindows.org/latest-tag.txt" -filename "gitlatesttag.txt"
|
||||
$gitVersion = getSimpleValue -url "https://gitforwindows.org/latest-version.txt" -filename "gitlatestversion.txt";
|
||||
|
||||
$installerFile = "Git-$gitVersion-64-bit.exe";
|
||||
$downloadUrl = "https://github.com/git-for-windows/git/releases/download/$gitTag/$installerFile";
|
||||
Install-Exe -Url $downloadUrl `
|
||||
-Name $installerFile `
|
||||
-ArgumentList (
|
||||
"/VERYSILENT", `
|
||||
"/NORESTART", `
|
||||
"/NOCANCEL", `
|
||||
"/SP-", `
|
||||
"/CLOSEAPPLICATIONS", `
|
||||
"/RESTARTAPPLICATIONS", `
|
||||
"/o:PathOption=CmdTools", `
|
||||
"/o:BashTerminalOption=ConHost", `
|
||||
"/COMPONENTS=gitlfs")
|
||||
|
||||
choco install hub
|
||||
|
||||
# Disable GCM machine-wide
|
||||
|
||||
Reference in New Issue
Block a user