Install apt packages host jobs need (libatomic1 for Node 26)

actions/setup-node's Node 26 fails on minimal Ubuntu 24.04 with
'libatomic.so.1: cannot open shared object file'. RUNNER_APT_PACKAGES in
the host file lists packages install.sh installs when missing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-11-27 14:18:54 +00:00
co-authored by Claude Opus 5.5
parent 27260ee85e
commit de9ce7ce47
4 changed files with 24 additions and 1 deletions
+16
View File
@@ -68,6 +68,22 @@ if [ "$current" != "v${VERSION}" ]; then
changed=1
fi
# --- host packages -----------------------------------------------------------
# Libraries host-mode jobs need that a minimal Ubuntu lacks, e.g. libatomic1
# for the Node 26 that actions/setup-node installs.
if [ -n "${RUNNER_APT_PACKAGES:-}" ]; then
read -ra pkgs <<<"$RUNNER_APT_PACKAGES"
missing=()
for p in "${pkgs[@]}"; do
dpkg-query -W -f='${Status}' "$p" 2>/dev/null | grep -q "ok installed" || missing+=("$p")
done
if [ ${#missing[@]} -gt 0 ]; then
echo "Installing packages: ${missing[*]}"
apt-get update -qq
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq "${missing[@]}"
fi
fi
# --- node (host-mode JavaScript actions) -------------------------------------
# In host mode the runner runs actions such as actions/checkout with the
# host's `node`. Only `node` goes on PATH: the job's own Node comes from