There was an error while loading. Please reload this page.
1 parent b465142 commit f2506daCopy full SHA for f2506da
1 file changed
src/download.ts
@@ -21,12 +21,17 @@ function getRunner(): string {
21
case "darwin":
22
return "macos-10.15";
23
case "linux":
24
- // TODO: Is there better way to determine Actions runner OS?
25
- if (os.release().startsWith("4.15")) {
26
- return "ubuntu-16.04";
27
- } else {
28
- return "ubuntu-18.04";
+ for (const line of require("fs")
+ .readFileSync("/etc/os-release", {
+ encoding: "utf8",
+ })
+ .split("\n")) {
29
+ if (line.startsWith("VERSION_ID=")) {
30
+ return "ubuntu-" + line.substring(10).replaceAll(/"/g, "");
31
+ }
32
}
33
+
34
+ throw new Error("Unrecognized version of Ubuntu");
35
default:
36
throw new Error("Unsupported OS");
37
0 commit comments