diff --git a/dist/cache-save/index.js b/dist/cache-save/index.js index 3c55a891..2afcb07d 100644 --- a/dist/cache-save/index.js +++ b/dist/cache-save/index.js @@ -51256,7 +51256,10 @@ class CacheDistributor { if (!utils_1.IS_LINUX) { return ''; } - const osInfo = await (0, utils_1.getLinuxInfo)(); + const osInfo = await (0, utils_1.getOSInfo)(); + if (!osInfo) { + return ''; + } // lsb_release reports RHEL as "RedHatEnterpriseLinux" while /etc/os-release // reports it as "rhel"; normalize both to "rhel" so the key is consistent. const normalizedName = osInfo.osName.toLowerCase(); diff --git a/dist/setup/index.js b/dist/setup/index.js index 1dee63d9..ff8ca6e4 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -53838,7 +53838,10 @@ class CacheDistributor { if (!utils_1.IS_LINUX) { return ''; } - const osInfo = await (0, utils_1.getLinuxInfo)(); + const osInfo = await (0, utils_1.getOSInfo)(); + if (!osInfo) { + return ''; + } // lsb_release reports RHEL as "RedHatEnterpriseLinux" while /etc/os-release // reports it as "rhel"; normalize both to "rhel" so the key is consistent. const normalizedName = osInfo.osName.toLowerCase(); diff --git a/src/cache-distributions/cache-distributor.ts b/src/cache-distributions/cache-distributor.ts index 1a11433d..4a3348a4 100644 --- a/src/cache-distributions/cache-distributor.ts +++ b/src/cache-distributions/cache-distributor.ts @@ -1,6 +1,6 @@ import * as cache from '@actions/cache'; import * as core from '@actions/core'; -import {getLinuxInfo, IS_LINUX} from '../utils'; +import {getOSInfo, IS_LINUX} from '../utils'; import {CACHE_DEPENDENCY_BACKUP_PATH} from './constants'; export enum State { @@ -32,7 +32,11 @@ abstract class CacheDistributor { return ''; } - const osInfo = await getLinuxInfo(); + const osInfo = await getOSInfo(); + if (!osInfo) { + return ''; + } + // lsb_release reports RHEL as "RedHatEnterpriseLinux" while /etc/os-release // reports it as "rhel"; normalize both to "rhel" so the key is consistent. const normalizedName = osInfo.osName.toLowerCase();