Fix CI: host-mode runner has no Node.js for actions/checkout
CI / check (push) Successful in 7m3s
CI / deploy (push) Failing after 1s

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.
This commit is contained in:
randy committed 2026-08-27 15:39:47 +02:00
1 parent 3a79c3d6c1
commit 71e638b459
2 files changed
+15 -1

No files matched your search

+10 -1
View File
@@ -40,7 +40,16 @@ jobs:
if: github.event_name == 'push' && github.ref == 'refs/heads/main' if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: host runs-on: host
steps: 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 # /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 # on the real host (1:1 bind mount) — required so the relative bind
+5
View File
@@ -112,6 +112,11 @@ of Puma's bind address.
`.gitea/workflows/ci.yml`'s `deploy` job runs after `check` passes, only `.gitea/workflows/ci.yml`'s `deploy` job runs after `check` passes, only
on a push to `main`, with `runs-on: host`: 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 . Copies the checkout into `/srv/docker/maptool/` using plain
`cp`/`rm` (no `rsync` in the runner image): clears everything in the `cp`/`rm` (no `rsync` in the runner image): clears everything in the
target except `data/`, copies the fresh checkout over, then drops target except `data/`, copies the fresh checkout over, then drops