From 3cbcb44cf51662285624c885b0760f800c2ea6dd Mon Sep 17 00:00:00 2001 From: Joakim Persson Date: Sun, 24 May 2026 15:59:53 +0000 Subject: [PATCH] CI: fix resolve-versions to use curl+jq instead of npm view MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit catthehacker/ubuntu:act-latest ships Node/npm under /opt/acttoolcache/ with PATH updated only in /etc/environment. act_runner (nektos/act) does not source /etc/environment — it reads the Docker image's ENV instructions (inspectResult.Config.Env) which only contain DEBIAN_FRONTEND=noninteractive. So npm is NOT on PATH and 'npm view ...' would have CI-failed on first run. Fix: query the npm registry HTTP API directly with curl+jq, both of which are already used extensively by this workflow (curl for Hub auth/manifest inspect, jq for token parsing). The endpoint https://registry.npmjs.org//latest returns JSON with a 'version' field — equivalent to 'npm view version' but with no toolchain dependency. Verified locally: both URLs resolve correctly to 0.75.5 (pi) and 1.1.1 (omos). Evidence: nektos/act pkg/container/docker_run.go reads imageEnv from inspectResult.Config.Env, not /etc/environment. DefaultPathVariable() in linux_container_environment_extensions.go returns a hardcoded path with no /opt/acttoolcache in it. --- .gitea/workflows/docker-publish-split.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/docker-publish-split.yml b/.gitea/workflows/docker-publish-split.yml index 2e60f65..e89ea5f 100644 --- a/.gitea/workflows/docker-publish-split.yml +++ b/.gitea/workflows/docker-publish-split.yml @@ -123,12 +123,17 @@ jobs: pi_version: ${{ steps.resolve.outputs.pi_version }} omos_version: ${{ steps.resolve.outputs.omos_version }} steps: - - name: Resolve pi + omos versions from npm + - name: Resolve pi + omos versions from npm registry id: resolve run: | set -eu - PI_VERSION=$(npm view @earendil-works/pi-coding-agent version) - OMOS_VERSION=$(npm view oh-my-opencode-slim version) + # Query the npm registry directly via curl+jq rather than `npm view`. + # catthehacker/ubuntu:act-latest ships Node/npm under /opt/acttoolcache/ + # and adds it to PATH only via /etc/environment — which act_runner never + # sources (it reads the Docker image's ENV instructions, not /etc/environment). + # curl and jq are both guaranteed present in every job in this workflow. + PI_VERSION=$(curl -sf "https://registry.npmjs.org/@earendil-works%2Fpi-coding-agent/latest" | jq -r '.version') + OMOS_VERSION=$(curl -sf "https://registry.npmjs.org/oh-my-opencode-slim/latest" | jq -r '.version') echo "pi_version=${PI_VERSION}" >> "$GITHUB_OUTPUT" echo "omos_version=${OMOS_VERSION}" >> "$GITHUB_OUTPUT" echo "Resolved PI_VERSION=${PI_VERSION}, OMOS_VERSION=${OMOS_VERSION}"