From 99e22b3d7de0c911c564cd391d4f9dae79ae176e Mon Sep 17 00:00:00 2001 From: GP Date: Thu, 20 Apr 2023 17:46:16 +0530 Subject: [PATCH 1/2] fix(core): support ARM 64-bit environments Fixes https://github.com/paambaati/codeclimate-action/issues/663 --- src/main.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index 0ce4fa9a..f64d197a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,4 +1,4 @@ -import { platform } from 'os'; +import { platform, arch } from 'os'; import { chdir } from 'process'; import { unlinkSync } from 'fs'; import { debug, error, setFailed, warning, info } from '@actions/core'; @@ -13,8 +13,9 @@ import { } from './utils'; import type { ExecOptions } from '@actions/exec/lib/interfaces'; +// REFER: https://docs.codeclimate.com/docs/configuring-test-coverage#locations-of-pre-built-binaries /** Canonical download URL for the official CodeClimate reporter. */ -export const DOWNLOAD_URL = `https://codeclimate.com/downloads/test-reporter/test-reporter-latest-${platform()}-amd64`; +export const DOWNLOAD_URL = `https://codeclimate.com/downloads/test-reporter/test-reporter-latest-${platform()}-${arch() === 'arm64' ? 'arm64' : 'amd64'}`; /** Local file name of the CodeClimate reporter. */ export const EXECUTABLE = './cc-reporter'; export const CODECLIMATE_GPG_PUBLIC_KEY_ID = From 0a8b271d81eab2f142ce9ce1d10d0f1bdb3cda5c Mon Sep 17 00:00:00 2001 From: GP Date: Fri, 21 Apr 2023 10:18:21 +0530 Subject: [PATCH 2/2] chore(core): reformat changed files --- src/main.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index f64d197a..7ab7732c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -15,7 +15,9 @@ import type { ExecOptions } from '@actions/exec/lib/interfaces'; // REFER: https://docs.codeclimate.com/docs/configuring-test-coverage#locations-of-pre-built-binaries /** Canonical download URL for the official CodeClimate reporter. */ -export const DOWNLOAD_URL = `https://codeclimate.com/downloads/test-reporter/test-reporter-latest-${platform()}-${arch() === 'arm64' ? 'arm64' : 'amd64'}`; +export const DOWNLOAD_URL = `https://codeclimate.com/downloads/test-reporter/test-reporter-latest-${platform()}-${ + arch() === 'arm64' ? 'arm64' : 'amd64' +}`; /** Local file name of the CodeClimate reporter. */ export const EXECUTABLE = './cc-reporter'; export const CODECLIMATE_GPG_PUBLIC_KEY_ID =