diff --git a/CHANGELOG.md b/CHANGELOG.md index 21e812c9f..edd47daa7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th ## [UNRELEASED] -No user facing changes. +- The CodeQL Action now supports running on Linux Arm64 runners, downloading the native `linux-arm64` CodeQL bundle. [#4072](https://github.com/github/codeql-action/pull/4072) ## 4.37.5 - 03 Aug 2026 diff --git a/lib/entry-points.js b/lib/entry-points.js index cdd0db217..3183db546 100644 --- a/lib/entry-points.js +++ b/lib/entry-points.js @@ -147777,6 +147777,7 @@ var toolrunner3 = __toESM(require_toolrunner()); // src/cli-errors.ts var SUPPORTED_PLATFORMS = [ ["linux", "x64"], + ["linux", "arm64"], ["win32", "x64"], ["darwin", "x64"], ["darwin", "arm64"] @@ -150946,7 +150947,7 @@ function getCodeQLBundleName(compressionMethod) { if (process.platform === "win32") { platform2 = "win64"; } else if (process.platform === "linux") { - platform2 = "linux64"; + platform2 = process.arch === "arm64" ? "linux-arm64" : "linux64"; } else if (process.platform === "darwin") { platform2 = "osx64"; } else { diff --git a/src/cli-errors.test.ts b/src/cli-errors.test.ts index 9e2d7dc79..1a83def51 100644 --- a/src/cli-errors.test.ts +++ b/src/cli-errors.test.ts @@ -128,7 +128,6 @@ test("CliError constructor with empty stderr", (t) => { for (const [platform, arch] of [ ["weird_plat", "x64"], - ["linux", "arm64"], ["win32", "arm64"], ]) { test.serial( diff --git a/src/cli-errors.ts b/src/cli-errors.ts index 84ec1aa4e..608413002 100644 --- a/src/cli-errors.ts +++ b/src/cli-errors.ts @@ -8,6 +8,7 @@ import { ConfigurationError } from "./util"; const SUPPORTED_PLATFORMS = [ ["linux", "x64"], + ["linux", "arm64"], ["win32", "x64"], ["darwin", "x64"], ["darwin", "arm64"], diff --git a/src/setup-codeql.test.ts b/src/setup-codeql.test.ts index 219e39984..be74bee70 100644 --- a/src/setup-codeql.test.ts +++ b/src/setup-codeql.test.ts @@ -120,24 +120,35 @@ test.serial( const LINKED_BUNDLE_TEST_CASES = [ { platform: "linux", + arch: "x64", tarSupportsZstd: true, expectedBundleName: "codeql-bundle-linux64.tar.zst", expectedCompressionMethod: "zstd", }, + { + platform: "linux", + arch: "arm64", + tarSupportsZstd: true, + expectedBundleName: "codeql-bundle-linux-arm64.tar.zst", + expectedCompressionMethod: "zstd", + }, { platform: "darwin", + arch: "arm64", tarSupportsZstd: true, expectedBundleName: "codeql-bundle-osx64.tar.zst", expectedCompressionMethod: "zstd", }, { platform: "win32", + arch: "x64", tarSupportsZstd: true, expectedBundleName: "codeql-bundle-win64.tar.gz", expectedCompressionMethod: "gzip", }, { platform: "linux", + arch: "x64", tarSupportsZstd: false, expectedBundleName: "codeql-bundle-linux64.tar.gz", expectedCompressionMethod: "gzip", @@ -146,6 +157,7 @@ const LINKED_BUNDLE_TEST_CASES = [ for (const { platform, + arch, tarSupportsZstd, expectedBundleName, expectedCompressionMethod, @@ -155,6 +167,7 @@ for (const { async (t) => { const features = createFeatures([]); sinon.stub(process, "platform").value(platform); + sinon.stub(process, "arch").value(arch); await withTmpDir(async (tmpDir) => { setupActionsVars(tmpDir, tmpDir); diff --git a/src/setup-codeql.ts b/src/setup-codeql.ts index 8d374585a..9b2f6dc06 100644 --- a/src/setup-codeql.ts +++ b/src/setup-codeql.ts @@ -75,7 +75,7 @@ export function getCodeQLBundleName( if (process.platform === "win32") { platform = "win64"; } else if (process.platform === "linux") { - platform = "linux64"; + platform = process.arch === "arm64" ? "linux-arm64" : "linux64"; } else if (process.platform === "darwin") { platform = "osx64"; } else { diff --git a/src/testing-utils.ts b/src/testing-utils.ts index 279459275..aa1b9dc38 100644 --- a/src/testing-utils.ts +++ b/src/testing-utils.ts @@ -936,7 +936,9 @@ export function mockBundleDownloadApi({ process.platform === "win32" ? "win64" : process.platform === "linux" - ? "linux64" + ? process.arch === "arm64" + ? "linux-arm64" + : "linux64" : "osx64"; const baseUrl = apiDetails?.url ?? "https://example.com";