Remove console logs and debug version

This commit is contained in:
panticmilos 2022-07-18 18:16:11 +02:00
parent f22ce50675
commit 6e46140c9c
3 changed files with 14 additions and 14 deletions

View file

@ -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}`;
}

View file

@ -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}`;
}