Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 7 additions & 4 deletions src/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -38,5 +42,4 @@ async function downloadGhCli(version) {
throw err;
}
}

run();