Skip to content

Commit eef2976

Browse files
feature: Add multi architecture support (#10)
* feature: Add multi architecture support * feature: Pick up arch from host Updated readme and actual code to use process.arch and based on that downloads actual binary * fix : cleanup action.yaml * feature: Add correct logic to pick up arm64 or amd64 architecture (#3) * feature: Add correct logic to pick up arm64 or amd64 architecture * feature: Add correct logic to pick up arm64 or amd64 architecture * feature: Add correct logic to pick up arm64 or amd64 architecture * feature: Add correct logic to pick up arm64 or amd64 architecture * feature: Add correct logic to pick up arm64 or amd64 architecture * fix: Update README.md that supports only amd64 and arm64 architectures (#4) * feature: Add correct logic to pick up arm64 or amd64 architecture * feature: Add correct logic to pick up arm64 or amd64 architecture * feature: Add correct logic to pick up arm64 or amd64 architecture * feature: Add correct logic to pick up arm64 or amd64 architecture * feature: Add correct logic to pick up arm64 or amd64 architecture * fix: Update README.md that supports only amd64 and arm64 architectures
1 parent 2d19dc3 commit eef2976

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Selfhosted runners do not come with the GH CLI out of the box. This action is an easy-to-use way to install it.
44

5-
As of now, only linux amd64 is supported.
5+
Supports linux on amd64 and arm64 architectures.
66

77
## Usage
88

src/run.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,14 @@ async function getGhCli(version) {
2525
}
2626

2727
async function downloadGhCli(version) {
28-
const toolDirectoryName = `gh_${version}_linux_amd64`;
29-
const downloadUrl = `https://github.com/cli/cli/releases/download/v${version}/gh_${version}_linux_amd64.tar.gz`;
30-
console.log(`downloading ${downloadUrl}`);
3128

29+
let architecture = 'amd64';
30+
if (process.arch == 'arm64') {
31+
architecture = 'arm64';
32+
}
33+
const toolDirectoryName = `gh_${version}_linux_${architecture}`;
34+
const downloadUrl = `https://github.com/cli/cli/releases/download/v${version}/gh_${version}_linux_${architecture}.tar.gz`;
35+
console.log(`downloading ${downloadUrl}`);
3236
try {
3337
const downloadPath = await tc.downloadTool(downloadUrl);
3438
const extractedPath = await tc.extractTar(downloadPath);
@@ -38,5 +42,4 @@ async function downloadGhCli(version) {
3842
throw err;
3943
}
4044
}
41-
4245
run();

0 commit comments

Comments
 (0)