mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-18 15:56:47 +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
|
Import-Module -Name ImageHelpers
|
||||||
|
|
||||||
# Install the latest version of Git which is bundled with Git LFS.
|
function getSimpleValue([string] $url, [string] $filename ) {
|
||||||
# See https://chocolatey.org/packages/git
|
$fullpath = "${env:Temp}\$filename"
|
||||||
choco install git -y --package-parameters="/GitAndUnixToolsOnPath /WindowsTerminal /NoShellIntegration"
|
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
|
choco install hub
|
||||||
|
|
||||||
# Disable GCM machine-wide
|
# Disable GCM machine-wide
|
||||||
|
|||||||
Reference in New Issue
Block a user