From 71e638b45937bde49b6e818097a0e303c58fff64 Mon Sep 17 00:00:00 2001 From: Roman Priesol Date: Thu, 27 Aug 2026 15:39:47 +0200 Subject: [PATCH] Fix CI: host-mode runner has no Node.js for actions/checkout Host-mode jobs run directly in the runner container instead of a spawned per-job container, so JS actions like actions/checkout@v4 have no Node.js runtime to execute with. Replace it with a plain git fetch/checkout in the deploy job. --- .gitea/workflows/ci.yml | 11 ++++++++++- docs/deployment.adoc | 5 +++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 703eec2..f733f4b 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -40,7 +40,16 @@ jobs: if: github.event_name == 'push' && github.ref == 'refs/heads/main' runs-on: host steps: - - uses: actions/checkout@v4 + # Not actions/checkout@v4: it's a JS action and host-mode jobs run + # directly in the runner container, which has git but no Node.js. + - name: Checkout + run: | + rm -rf .git * .[!.]* 2>/dev/null + git init -q + git remote add origin "${{ gitea.server_url }}/${{ gitea.repository }}.git" + git -c http.extraHeader="Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + fetch --depth 1 origin "${{ gitea.sha }}" + git checkout -q FETCH_HEAD # /srv/docker/maptool is the same path inside the runner container and # on the real host (1:1 bind mount) — required so the relative bind diff --git a/docs/deployment.adoc b/docs/deployment.adoc index 1e5da41..ff9b26c 100644 --- a/docs/deployment.adoc +++ b/docs/deployment.adoc @@ -112,6 +112,11 @@ of Puma's bind address. `.gitea/workflows/ci.yml`'s `deploy` job runs after `check` passes, only on a push to `main`, with `runs-on: host`: +. Checks out the repo with plain `git` (`fetch` + `checkout`, + authenticated via a one-off `http.extraHeader`), not + `actions/checkout@v4` — that's a JS action, and host-mode jobs run + directly in the runner container, which has `git` but no Node.js + runtime to execute JS actions with. . Copies the checkout into `/srv/docker/maptool/` using plain `cp`/`rm` (no `rsync` in the runner image): clears everything in the target except `data/`, copies the fresh checkout over, then drops