From ed73b5df24d31a50feea1e4d7296df2b5840941d Mon Sep 17 00:00:00 2001 From: Hans Gaiser Date: Tue, 9 Jun 2026 13:12:37 +0200 Subject: [PATCH] fix: use BUILD_ID as backup for determining os version (#912) On Arch Linux based runners, the setup fails with because `/etc/os-release` does not contain `VERSION_ID` or `VERSION_CODENAME`. It does contain a `BUILD_ID` which is set to `rolling`: ```sh $ cat /etc/os-release NAME="Arch Linux" PRETTY_NAME="Arch Linux" ID=arch BUILD_ID=rolling ANSI_COLOR="38;2;23;147;209" HOME_URL="https://archlinux.org/" DOCUMENTATION_URL="https://wiki.archlinux.org/" SUPPORT_URL="https://bbs.archlinux.org/" BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues" PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/" LOGO=archlinux-logo ``` This PR makes `getLinuxOSNameVersion` return `arch-rolling`. There is no update from arch that would change the returned value, so the same cache will always be used. Is this an issue? I'm not sure. At least it's better than crashing because `os-release` does not contain the expected values :). --- dist/setup/index.cjs | 4 ++++ src/utils/platforms.ts | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/dist/setup/index.cjs b/dist/setup/index.cjs index 903fdf0..25b202b 100644 --- a/dist/setup/index.cjs +++ b/dist/setup/index.cjs @@ -91160,12 +91160,16 @@ function getLinuxOSNameVersion() { const id = parseOsReleaseValue(content, "ID"); const versionId2 = parseOsReleaseValue(content, "VERSION_ID"); const versionCodename = parseOsReleaseValue(content, "VERSION_CODENAME"); + const buildId = parseOsReleaseValue(content, "BUILD_ID"); if (id && versionId2) { return `${id}-${versionId2}`; } if (id && versionCodename) { return `${id}-${versionCodename}`; } + if (id && buildId) { + return `${id}-${buildId}`; + } } catch { } } diff --git a/src/utils/platforms.ts b/src/utils/platforms.ts index 130479f..96c877d 100644 --- a/src/utils/platforms.ts +++ b/src/utils/platforms.ts @@ -109,8 +109,9 @@ function getLinuxOSNameVersion(): string { const id = parseOsReleaseValue(content, "ID"); const versionId = parseOsReleaseValue(content, "VERSION_ID"); // Fallback for rolling releases (debian:unstable/testing, arch, etc.) - // that don't have VERSION_ID but have VERSION_CODENAME + // that don't have VERSION_ID but have VERSION_CODENAME or BUILD_ID const versionCodename = parseOsReleaseValue(content, "VERSION_CODENAME"); + const buildId = parseOsReleaseValue(content, "BUILD_ID"); if (id && versionId) { return `${id}-${versionId}`; @@ -118,6 +119,9 @@ function getLinuxOSNameVersion(): string { if (id && versionCodename) { return `${id}-${versionCodename}`; } + if (id && buildId) { + return `${id}-${buildId}`; + } } catch { // Try next file }