mirror of
https://github.com/actions/setup-python.git
synced 2026-07-18 14:39:58 +08:00
Refactor OS info retrieval to use getOSInfo and handle null cases for improved reliability
This commit is contained in:
parent
f1ee88690f
commit
5ad36cd2ac
3 changed files with 14 additions and 4 deletions
5
dist/cache-save/index.js
vendored
5
dist/cache-save/index.js
vendored
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue