fix(runner): install Node.js 20 on host before starting runner (required for JS actions in host mode)

This commit is contained in:
xtcnet 2026-03-18 21:59:07 +07:00
parent 9a5325a38d
commit d73582e75d

View file

@ -755,8 +755,21 @@ do_forgejo_runner_install() {
install_deps install_deps
echo "" echo ""
# --- Node.js 20 (required for JS-based actions in host mode) ---
log_step "Checking Node.js..."
if node --version 2>/dev/null | grep -q "^v2"; then
log_ok "Node.js $(node --version) already installed."
else
log_step "Installing Node.js 20 LTS..."
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - > /dev/null 2>&1
apt-get install -y nodejs > /dev/null 2>&1
log_ok "Node.js $(node --version) installed."
fi
echo ""
if docker ps -a --format '{{.Names}}' | grep -q "^${FORGEJO_RUNNER_CONTAINER}$"; then if docker ps -a --format '{{.Names}}' | grep -q "^${FORGEJO_RUNNER_CONTAINER}$"; then
log_warn "Forgejo Runner is already installed." log_warn "Forgejo Runner is already installed."
return return
fi fi