From 61dd67fbf505996f2201bbcd6e37e9b4327c56d2 Mon Sep 17 00:00:00 2001 From: panticmilos Date: Wed, 10 Aug 2022 20:11:20 +0200 Subject: [PATCH] Add default value if arch is null --- dist/setup/index.js | 4 +++- src/main.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index b1434bd..7b3f5dc 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -63138,6 +63138,7 @@ const cache_restore_1 = __nccwpck_require__(9517); const cache_utils_1 = __nccwpck_require__(1678); const child_process_1 = __importDefault(__nccwpck_require__(2081)); const fs_1 = __importDefault(__nccwpck_require__(7147)); +const os_1 = __importDefault(__nccwpck_require__(2037)); function run() { return __awaiter(this, void 0, void 0, function* () { try { @@ -63148,7 +63149,8 @@ function run() { const versionSpec = resolveVersionInput(); const cache = core.getBooleanInput('cache'); core.info(`Setup go version spec ${versionSpec}`); - const arch = core.getInput('architecture'); + let arch = core.getInput('architecture'); + arch = arch ? arch : os_1.default.arch(); if (versionSpec) { let token = core.getInput('token'); let auth = !token || cache_utils_1.isGhes() ? undefined : `token ${token}`; diff --git a/src/main.ts b/src/main.ts index b7fb133..e4062df 100644 --- a/src/main.ts +++ b/src/main.ts @@ -7,6 +7,7 @@ import {restoreCache} from './cache-restore'; import {isGhes, isCacheFeatureAvailable} from './cache-utils'; import cp from 'child_process'; import fs from 'fs'; +import os from 'os'; export async function run() { try { @@ -19,7 +20,8 @@ export async function run() { const cache = core.getBooleanInput('cache'); core.info(`Setup go version spec ${versionSpec}`); - const arch = core.getInput('architecture'); + let arch = core.getInput('architecture'); + arch = arch ? arch : os.arch(); if (versionSpec) { let token = core.getInput('token');