Add default value if arch is null

This commit is contained in:
panticmilos 2022-08-10 20:11:20 +02:00
parent 1776f915f8
commit 61dd67fbf5
2 changed files with 6 additions and 2 deletions

4
dist/setup/index.js vendored
View file

@ -63138,6 +63138,7 @@ const cache_restore_1 = __nccwpck_require__(9517);
const cache_utils_1 = __nccwpck_require__(1678); const cache_utils_1 = __nccwpck_require__(1678);
const child_process_1 = __importDefault(__nccwpck_require__(2081)); const child_process_1 = __importDefault(__nccwpck_require__(2081));
const fs_1 = __importDefault(__nccwpck_require__(7147)); const fs_1 = __importDefault(__nccwpck_require__(7147));
const os_1 = __importDefault(__nccwpck_require__(2037));
function run() { function run() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
try { try {
@ -63148,7 +63149,8 @@ function run() {
const versionSpec = resolveVersionInput(); const versionSpec = resolveVersionInput();
const cache = core.getBooleanInput('cache'); const cache = core.getBooleanInput('cache');
core.info(`Setup go version spec ${versionSpec}`); 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) { if (versionSpec) {
let token = core.getInput('token'); let token = core.getInput('token');
let auth = !token || cache_utils_1.isGhes() ? undefined : `token ${token}`; let auth = !token || cache_utils_1.isGhes() ? undefined : `token ${token}`;

View file

@ -7,6 +7,7 @@ import {restoreCache} from './cache-restore';
import {isGhes, isCacheFeatureAvailable} from './cache-utils'; import {isGhes, isCacheFeatureAvailable} from './cache-utils';
import cp from 'child_process'; import cp from 'child_process';
import fs from 'fs'; import fs from 'fs';
import os from 'os';
export async function run() { export async function run() {
try { try {
@ -19,7 +20,8 @@ export async function run() {
const cache = core.getBooleanInput('cache'); const cache = core.getBooleanInput('cache');
core.info(`Setup go version spec ${versionSpec}`); core.info(`Setup go version spec ${versionSpec}`);
const arch = core.getInput('architecture'); let arch = core.getInput('architecture');
arch = arch ? arch : os.arch();
if (versionSpec) { if (versionSpec) {
let token = core.getInput('token'); let token = core.getInput('token');