From 6e46140c9c36e79b1d020f4d50a3b42dd17cfcf6 Mon Sep 17 00:00:00 2001 From: panticmilos Date: Mon, 18 Jul 2022 18:16:11 +0200 Subject: [PATCH] Remove console logs and debug version --- dist/setup/index.js | 9 +++------ src/cache-distributions/pip-cache.ts | 2 -- src/utils.ts | 17 +++++++++++------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index 444c3ad4..e5fe26e0 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -64433,13 +64433,11 @@ class PipCache extends cache_distributor_1.default { let primaryKey = ''; let restoreKey = ''; if (utils_1.IS_LINUX) { - console.log('here'); const osRelease = yield utils_1.getLinuxOSReleaseInfo(); primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${osRelease}-python-${this.pythonVersion}-${this.packageManager}-${hash}`; restoreKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${osRelease}-python-${this.pythonVersion}-${this.packageManager}`; } else { - console.log('here2'); primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-python-${this.pythonVersion}-${this.packageManager}-${hash}`; restoreKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-python-${this.pythonVersion}-${this.packageManager}`; } @@ -65486,19 +65484,18 @@ function isCacheFeatureAvailable() { exports.isCacheFeatureAvailable = isCacheFeatureAvailable; function getLinuxOSReleaseInfo() { return __awaiter(this, void 0, void 0, function* () { - const versionId = yield exec.getExecOutput('lsb_release', ['-a'], { + const { stdout, stderr, exitCode } = yield exec.getExecOutput('lsb_release', ['-a'], { silent: true }); let osVersion = ''; let osRelease = ''; - versionId.stdout.split('\n').forEach(elem => { + stdout.split('\n').forEach(elem => { if (elem.includes('Distributor')) osVersion = elem.split(':')[1].trim(); if (elem.includes('Release')) osRelease = elem.split(':')[1].trim(); }); - core.info(osRelease); - core.info(osVersion); + core.debug(`OS Release: ${osRelease}, Version: ${osVersion}`); return `${osVersion}-${osRelease}`; }); } diff --git a/src/cache-distributions/pip-cache.ts b/src/cache-distributions/pip-cache.ts index 11ff3e49..460b097c 100644 --- a/src/cache-distributions/pip-cache.ts +++ b/src/cache-distributions/pip-cache.ts @@ -61,12 +61,10 @@ class PipCache extends CacheDistributor { let restoreKey = ''; if (IS_LINUX) { - console.log('here'); const osRelease = await getLinuxOSReleaseInfo(); primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${osRelease}-python-${this.pythonVersion}-${this.packageManager}-${hash}`; restoreKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${osRelease}-python-${this.pythonVersion}-${this.packageManager}`; } else { - console.log('here2'); primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-python-${this.pythonVersion}-${this.packageManager}-${hash}`; restoreKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-python-${this.pythonVersion}-${this.packageManager}`; } diff --git a/src/utils.ts b/src/utils.ts index cf77e41f..085774e6 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -122,18 +122,23 @@ export function isCacheFeatureAvailable(): boolean { } export async function getLinuxOSReleaseInfo() { - const versionId = await exec.getExecOutput('lsb_release', ['-a'], { - silent: true - }); + const {stdout, stderr, exitCode} = await exec.getExecOutput( + 'lsb_release', + ['-a'], + { + silent: true + } + ); + let osVersion = ''; let osRelease = ''; - versionId.stdout.split('\n').forEach(elem => { + stdout.split('\n').forEach(elem => { if (elem.includes('Distributor')) osVersion = elem.split(':')[1].trim(); if (elem.includes('Release')) osRelease = elem.split(':')[1].trim(); }); - core.info(osRelease); - core.info(osVersion); + core.debug(`OS Release: ${osRelease}, Version: ${osVersion}`); + return `${osVersion}-${osRelease}`; }