From 6c0eb7840d1762dc756dc874e2eac2bd1890db86 Mon Sep 17 00:00:00 2001 From: v-sergei-pyshnoi <121864472+v-sergei-pyshnoi@users.noreply.github.com> Date: Wed, 18 Mar 2026 13:00:34 +0100 Subject: [PATCH 1/2] Add copilot CLI to Ubuntu images --- images/ubuntu/scripts/build/install-copilot-cli.sh | 11 +++++++++++ .../scripts/docs-gen/Generate-SoftwareReport.ps1 | 1 + .../ubuntu/scripts/docs-gen/SoftwareReport.Tools.psm1 | 5 +++++ images/ubuntu/scripts/tests/CLI.Tools.Tests.ps1 | 6 ++++++ images/ubuntu/templates/build.ubuntu-22_04.pkr.hcl | 3 ++- images/ubuntu/templates/build.ubuntu-24_04.pkr.hcl | 3 ++- 6 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 images/ubuntu/scripts/build/install-copilot-cli.sh diff --git a/images/ubuntu/scripts/build/install-copilot-cli.sh b/images/ubuntu/scripts/build/install-copilot-cli.sh new file mode 100644 index 0000000000..7b0093a700 --- /dev/null +++ b/images/ubuntu/scripts/build/install-copilot-cli.sh @@ -0,0 +1,11 @@ +#!/bin/bash -e +################################################################################ +## File: install-copilot-cli.sh +## Desc: Install the GitHub Copilot CLI +## Supply chain security: GitHub Copilot CLI - checksum validation (implemented inside installation script) +################################################################################ + +# Install GitHub Copilot CLI (Instruction taken from https://github.com/github/copilot-cli) +curl -fsSL https://gh.io/copilot-install | bash + +invoke_tests "CLI.Tools" "Github Copilot CLI" diff --git a/images/ubuntu/scripts/docs-gen/Generate-SoftwareReport.ps1 b/images/ubuntu/scripts/docs-gen/Generate-SoftwareReport.ps1 index 4f4be1bee3..f1037d6f3a 100644 --- a/images/ubuntu/scripts/docs-gen/Generate-SoftwareReport.ps1 +++ b/images/ubuntu/scripts/docs-gen/Generate-SoftwareReport.ps1 @@ -166,6 +166,7 @@ if (Test-IsUbuntu22) { $cliTools.AddToolVersion("ORAS CLI", $(Get-ORASCliVersion)) $cliTools.AddToolVersion("Vercel CLI", $(Get-VerselCliversion)) } +$cliTools.AddToolVersion("Github Copilot CLI", $(Get-GithubCopilotCliVersion)) # Java $installedSoftware.AddHeader("Java").AddTable($(Get-JavaVersionsTable)) diff --git a/images/ubuntu/scripts/docs-gen/SoftwareReport.Tools.psm1 b/images/ubuntu/scripts/docs-gen/SoftwareReport.Tools.psm1 index 9ea6c1f24b..a68c154447 100644 --- a/images/ubuntu/scripts/docs-gen/SoftwareReport.Tools.psm1 +++ b/images/ubuntu/scripts/docs-gen/SoftwareReport.Tools.psm1 @@ -271,3 +271,8 @@ function Get-YqVersion { $yqVersion = $(yq -V) | Get-StringPart -Part 3 return $yqVersion.TrimStart("v").Trim() } + +function Get-GithubCopilotCliVersion { + $copilotVersion = copilot --version | Get-StringPart -Part 3 + return "$copilotVersion".TrimEnd(".") +} diff --git a/images/ubuntu/scripts/tests/CLI.Tools.Tests.ps1 b/images/ubuntu/scripts/tests/CLI.Tools.Tests.ps1 index 9eb749d6fd..72a56a7951 100644 --- a/images/ubuntu/scripts/tests/CLI.Tools.Tests.ps1 +++ b/images/ubuntu/scripts/tests/CLI.Tools.Tests.ps1 @@ -53,3 +53,9 @@ Describe "Oras CLI" -Skip:((-not (Test-IsUbuntu22))) { "oras version" | Should -ReturnZeroExitCode } } + +Describe "Github Copilot CLI" { + It "gh cli" { + "copilot --version" | Should -ReturnZeroExitCode + } +} diff --git a/images/ubuntu/templates/build.ubuntu-22_04.pkr.hcl b/images/ubuntu/templates/build.ubuntu-22_04.pkr.hcl index 135af613f1..6a1a4aa1cb 100644 --- a/images/ubuntu/templates/build.ubuntu-22_04.pkr.hcl +++ b/images/ubuntu/templates/build.ubuntu-22_04.pkr.hcl @@ -157,7 +157,8 @@ build { "${path.root}/../scripts/build/install-pypy.sh", "${path.root}/../scripts/build/install-python.sh", "${path.root}/../scripts/build/install-zstd.sh", - "${path.root}/../scripts/build/install-ninja.sh" + "${path.root}/../scripts/build/install-ninja.sh", + "${path.root}/../scripts/build/install-copilot-cli.sh" ] } diff --git a/images/ubuntu/templates/build.ubuntu-24_04.pkr.hcl b/images/ubuntu/templates/build.ubuntu-24_04.pkr.hcl index 04dd1114eb..ae9b1fcff5 100644 --- a/images/ubuntu/templates/build.ubuntu-24_04.pkr.hcl +++ b/images/ubuntu/templates/build.ubuntu-24_04.pkr.hcl @@ -146,7 +146,8 @@ provisioner "shell" { "${path.root}/../scripts/build/install-pypy.sh", "${path.root}/../scripts/build/install-python.sh", "${path.root}/../scripts/build/install-zstd.sh", - "${path.root}/../scripts/build/install-ninja.sh" + "${path.root}/../scripts/build/install-ninja.sh", + "${path.root}/../scripts/build/install-copilot-cli.sh" ] } From 6bf6502a8342bc6ac595a52e4083cb01f4b9b26d Mon Sep 17 00:00:00 2001 From: v-sergei-pyshnoi <121864472+v-sergei-pyshnoi@users.noreply.github.com> Date: Wed, 18 Mar 2026 15:55:23 +0100 Subject: [PATCH 2/2] Change test name --- images/ubuntu/scripts/tests/CLI.Tools.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/ubuntu/scripts/tests/CLI.Tools.Tests.ps1 b/images/ubuntu/scripts/tests/CLI.Tools.Tests.ps1 index 72a56a7951..8c306d443a 100644 --- a/images/ubuntu/scripts/tests/CLI.Tools.Tests.ps1 +++ b/images/ubuntu/scripts/tests/CLI.Tools.Tests.ps1 @@ -55,7 +55,7 @@ Describe "Oras CLI" -Skip:((-not (Test-IsUbuntu22))) { } Describe "Github Copilot CLI" { - It "gh cli" { + It "Github Copilot CLI" { "copilot --version" | Should -ReturnZeroExitCode } }