Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions src/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,19 @@ function getRunner(): string {
case "darwin":
return "macos-10.15";
case "linux":
// TODO: Is there better way to determine Actions runner OS?
if (os.release().startsWith("4.15")) {
return "ubuntu-16.04";
} else {
return "ubuntu-18.04";
for (const line of require("fs")
.readFileSync("/etc/os-release", {
encoding: "utf8",
})
.split("\n")) {
if (line.startsWith("VERSION_ID=")) {
return (
"ubuntu-" + line.substring(10).replaceAll(/["']/g, "")
);
}
}

throw new Error("Unrecognized version of Ubuntu");
default:
throw new Error("Unsupported OS");
}
Expand Down