From 339df2842bf48fc3e94ca59ca4e943e1d87e5eac Mon Sep 17 00:00:00 2001 From: Salman Muin Kayser Chishti Date: Wed, 13 May 2026 14:34:08 +0000 Subject: [PATCH] Add GitHub Copilot CLI to hosted runner images Install @github/copilot via npm during image bake for Ubuntu 24.04 and 26.04. This pre-installs the Copilot CLI so agentic workflows using the Copilot engine do not need to install it at runtime, reducing workflow startup time. - Add install-copilot-cli.sh install script - Add Copilot CLI test to CLI.Tools.Tests.ps1 - Add to 24.04 and 26.04 Packer templates --- images/ubuntu/scripts/build/install-copilot-cli.sh | 14 ++++++++++++++ images/ubuntu/scripts/tests/CLI.Tools.Tests.ps1 | 6 ++++++ images/ubuntu/templates/build.ubuntu-24_04.pkr.hcl | 1 + images/ubuntu/templates/build.ubuntu-26_04.pkr.hcl | 1 + 4 files changed, 22 insertions(+) create mode 100755 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 100755 index 0000000000..7f5ed1f887 --- /dev/null +++ b/images/ubuntu/scripts/build/install-copilot-cli.sh @@ -0,0 +1,14 @@ +#!/bin/bash -e +################################################################################ +## File: install-copilot-cli.sh +## Desc: Install GitHub Copilot CLI via npm +################################################################################ + +# Source the helpers for use with the script +source $HELPER_SCRIPTS/install.sh + +echo "Installing GitHub Copilot CLI..." + +npm install -g @github/copilot --ignore-scripts + +invoke_tests "CLI.Tools" "Copilot CLI" diff --git a/images/ubuntu/scripts/tests/CLI.Tools.Tests.ps1 b/images/ubuntu/scripts/tests/CLI.Tools.Tests.ps1 index 9eb749d6fd..c35d30b55d 100644 --- a/images/ubuntu/scripts/tests/CLI.Tools.Tests.ps1 +++ b/images/ubuntu/scripts/tests/CLI.Tools.Tests.ps1 @@ -36,6 +36,12 @@ Describe "GitHub CLI" { } } +Describe "Copilot CLI" -Skip:(Test-IsUbuntu22) { + It "copilot cli" { + "copilot --version" | Should -ReturnZeroExitCode + } +} + Describe "Google Cloud CLI" { It "Google Cloud CLI" { "gcloud --version" | Should -ReturnZeroExitCode diff --git a/images/ubuntu/templates/build.ubuntu-24_04.pkr.hcl b/images/ubuntu/templates/build.ubuntu-24_04.pkr.hcl index 3f6ebc8d3c..93397623b1 100644 --- a/images/ubuntu/templates/build.ubuntu-24_04.pkr.hcl +++ b/images/ubuntu/templates/build.ubuntu-24_04.pkr.hcl @@ -111,6 +111,7 @@ provisioner "shell" { "${path.root}/../scripts/build/install-cmake.sh", "${path.root}/../scripts/build/install-codeql-bundle.sh", "${path.root}/../scripts/build/install-awf.sh", + "${path.root}/../scripts/build/install-copilot-cli.sh", "${path.root}/../scripts/build/install-container-tools.sh", "${path.root}/../scripts/build/install-dotnetcore-sdk.sh", "${path.root}/../scripts/build/install-microsoft-edge.sh", diff --git a/images/ubuntu/templates/build.ubuntu-26_04.pkr.hcl b/images/ubuntu/templates/build.ubuntu-26_04.pkr.hcl index 36ddc54235..3b98bf497b 100644 --- a/images/ubuntu/templates/build.ubuntu-26_04.pkr.hcl +++ b/images/ubuntu/templates/build.ubuntu-26_04.pkr.hcl @@ -110,6 +110,7 @@ provisioner "shell" { "${path.root}/../scripts/build/install-cmake.sh", "${path.root}/../scripts/build/install-codeql-bundle.sh", "${path.root}/../scripts/build/install-awf.sh", + "${path.root}/../scripts/build/install-copilot-cli.sh", "${path.root}/../scripts/build/install-container-tools.sh", "${path.root}/../scripts/build/install-dotnetcore-sdk.sh", "${path.root}/../scripts/build/install-microsoft-edge.sh",