fix: support debian:unstable/testing by falling back to VERSION_CODENAME

Debian unstable and testing don't have VERSION_ID in /etc/os-release.
This change falls back to VERSION_CODENAME when VERSION_ID is missing,
producing cache keys like 'debian-sid' for unstable.

Also adds a test job using debian:unstable container.

Fixes #773
This commit is contained in:
eifinger-bot 2026-02-27 15:41:13 +00:00
parent 0098a7571c
commit b94d46c9fc
4 changed files with 33 additions and 0 deletions

6
dist/save-cache/index.js generated vendored
View file

@ -91381,9 +91381,15 @@ function getLinuxOSNameVersion() {
const content = node_fs_1.default.readFileSync(file, "utf8");
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
const versionCodename = parseOsReleaseValue(content, "VERSION_CODENAME");
if (id && versionId) {
return `${id}-${versionId}`;
}
if (id && versionCodename) {
return `${id}-${versionCodename}`;
}
}
catch {
// Try next file

6
dist/setup/index.js generated vendored
View file

@ -97253,9 +97253,15 @@ function getLinuxOSNameVersion() {
const content = node_fs_1.default.readFileSync(file, "utf8");
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
const versionCodename = parseOsReleaseValue(content, "VERSION_CODENAME");
if (id && versionId) {
return `${id}-${versionId}`;
}
if (id && versionCodename) {
return `${id}-${versionCodename}`;
}
}
catch {
// Try next file