mirror of
https://github.com/actions/runner-images.git
synced 2025-12-19 08:22:12 +00:00
Install GitHub CLI on Windows images (#853)
* Install GitHub CLI on Windows images * Resolve comments Co-authored-by: Sergey Dolin <v-sedoli@micorosoft.com>
This commit is contained in:
@@ -370,6 +370,12 @@
|
|||||||
"{{ template_dir }}/scripts/Installers/Install-Git.ps1"
|
"{{ template_dir }}/scripts/Installers/Install-Git.ps1"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "powershell",
|
||||||
|
"scripts":[
|
||||||
|
"{{ template_dir }}/scripts/Installers/Install-GitHub-CLI.ps1"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "powershell",
|
"type": "powershell",
|
||||||
"environment_vars": [
|
"environment_vars": [
|
||||||
@@ -719,6 +725,12 @@
|
|||||||
"{{ template_dir }}/scripts/Installers/Validate-Git.ps1"
|
"{{ template_dir }}/scripts/Installers/Validate-Git.ps1"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "powershell",
|
||||||
|
"scripts":[
|
||||||
|
"{{ template_dir }}/scripts/Installers/Validate-GitHub-CLI.ps1"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "powershell",
|
"type": "powershell",
|
||||||
"environment_vars": [
|
"environment_vars": [
|
||||||
|
|||||||
@@ -343,6 +343,12 @@
|
|||||||
"{{ template_dir }}/scripts/Installers/Install-Git.ps1"
|
"{{ template_dir }}/scripts/Installers/Install-Git.ps1"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "powershell",
|
||||||
|
"scripts":[
|
||||||
|
"{{ template_dir }}/scripts/Installers/Install-GitHub-CLI.ps1"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "powershell",
|
"type": "powershell",
|
||||||
"environment_vars": [
|
"environment_vars": [
|
||||||
@@ -716,6 +722,12 @@
|
|||||||
"{{ template_dir }}/scripts/Installers/Validate-Git.ps1"
|
"{{ template_dir }}/scripts/Installers/Validate-Git.ps1"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "powershell",
|
||||||
|
"scripts":[
|
||||||
|
"{{ template_dir }}/scripts/Installers/Validate-GitHub-CLI.ps1"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "powershell",
|
"type": "powershell",
|
||||||
"environment_vars": [
|
"environment_vars": [
|
||||||
|
|||||||
10
images/win/scripts/Installers/Install-GitHub-CLI.ps1
Normal file
10
images/win/scripts/Installers/Install-GitHub-CLI.ps1
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
################################################################################
|
||||||
|
## File: Install-GitHub-CLI.ps1
|
||||||
|
## Desc: Install GitHub CLI
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
Import-Module -Name ImageHelpers -Force
|
||||||
|
|
||||||
|
Choco-Install -PackageName gh
|
||||||
|
|
||||||
|
Add-MachinePathItem "C:\Program Files (x86)\GitHub CLI"
|
||||||
27
images/win/scripts/Installers/Validate-GitHub-CLI.ps1
Normal file
27
images/win/scripts/Installers/Validate-GitHub-CLI.ps1
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
################################################################################
|
||||||
|
## File: Validate-GitHub-CLI.ps1
|
||||||
|
## Desc: Validate GitHub CLI
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
$command = Get-Command -Name 'gh'
|
||||||
|
|
||||||
|
if ($command)
|
||||||
|
{
|
||||||
|
Write-Host "gh on path"
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Write-Host 'gh is not on path'
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Adding description of the software to Markdown
|
||||||
|
$SoftwareName = "GitHub CLI"
|
||||||
|
|
||||||
|
$version = (gh --version).Split()[2]
|
||||||
|
|
||||||
|
$Description = @"
|
||||||
|
_Version:_ $version<br/>
|
||||||
|
"@
|
||||||
|
|
||||||
|
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||||
Reference in New Issue
Block a user