diff --git a/README.md b/README.md index 15f2b5d..8178c7e 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Selfhosted runners do not come with the GH CLI out of the box. This action is an easy-to-use way to install it. -As of now, only linux amd64 is supported. +Supports linux on amd64 and arm64 architectures. ## Usage diff --git a/src/run.js b/src/run.js index 4f8b943..f54d763 100644 --- a/src/run.js +++ b/src/run.js @@ -25,10 +25,14 @@ async function getGhCli(version) { } async function downloadGhCli(version) { - const toolDirectoryName = `gh_${version}_linux_amd64`; - const downloadUrl = `https://github.com/cli/cli/releases/download/v${version}/gh_${version}_linux_amd64.tar.gz`; - console.log(`downloading ${downloadUrl}`); + let architecture = 'amd64'; + if (process.arch == 'arm64') { + architecture = 'arm64'; + } + const toolDirectoryName = `gh_${version}_linux_${architecture}`; + const downloadUrl = `https://github.com/cli/cli/releases/download/v${version}/gh_${version}_linux_${architecture}.tar.gz`; + console.log(`downloading ${downloadUrl}`); try { const downloadPath = await tc.downloadTool(downloadUrl); const extractedPath = await tc.extractTar(downloadPath); @@ -38,5 +42,4 @@ async function downloadGhCli(version) { throw err; } } - run();