install
install copied to clipboard
Improve Ubuntu version detection (and prepare for imminent switch to 20.04 by default)
This PR makes the getRunner() function check /etc/os-release to determine the Ubuntu version, rather than hardcoding a kernel version check.
This is also important because the current implementation only checks for Ubuntu 16.04/18.04. Ubuntu 20.04 has been available for use in GitHub Actions for some time, and ubuntu-latest will soon default to ubuntu-20.04 (see actions/virtual-environments#1816).
(Edit: I don't write much Node, and I've never written TypeScript, so I'm happy to make changes to this.)
Hi, @cptpcrd and thanks for PR!
Looks great, but I'm a bit worried if it is safe to rely on VERSION_ID parameter? Ubuntu man page states that this field is optional.
Hi, @cptpcrd and thanks for PR!
Looks great, but I'm a bit worried if it is safe to rely on
VERSION_IDparameter? Ubuntu man page states that this field is optional.
AFAIK it's present on most systems that have an actual "version". For example, it's absent on Arch because Arch is rolling release, but I don't think I've ever seen it absent on a Debian-based system. (That man page appears to be copied directly from systemd's man page, which is written very generally, so I'm not surprised that it mentions certain fields being optional when they're actually present on Ubuntu).
I don't know of another "good" way to reliably detect the version of Ubuntu without getting too complicated (i.e. spawning processes and parsing output), except maybe /etc/lsb-release (which is nonstandard).
@svartalf can this be merged?
@svartalf The migration to Ubuntu 20.04 began more than a month ago. Is it possible to get this merged (probably along with actions-rs/tool-cache#9)?