From 4ffe817d5f2dbd08b3b4ec658784ebeecbd69535 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 14 Oct 2026 20:13:21 +0000 Subject: [PATCH] Stage script: use node instead of jq The Gitea runner's container image has node but no jq, so the first dev deploy died with exit 127 in stage-pages-site.sh. Same behaviour, tested against mock servers for: other channel published, 200-with-HTML, 404, and unreachable. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01JdMNbY5hLR7FjtfEE712xG --- .github/scripts/stage-pages-site.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/scripts/stage-pages-site.sh b/.github/scripts/stage-pages-site.sh index 4521fe9..e91432e 100755 --- a/.github/scripts/stage-pages-site.sh +++ b/.github/scripts/stage-pages-site.sh @@ -22,8 +22,9 @@ cp site/index.html site/404.html site/_headers "$out/" name="$(basename "$apk")" cp "$apk" "$out/$channel/$name" cp "$apk" "$out/$channel/ProLibertateGames.apk" -jq -n --arg tag "$tag" --arg name "$name" --arg ch "$channel" --arg url "$base/$channel/$name" \ - '{tag: $tag, apkName: $name, apkUrl: $url, channel: $ch}' > "$out/$channel/latest.json" +# node rather than jq: the Gitea runner's image has node but not jq. +node -e 'console.log(JSON.stringify({tag: process.argv[1], apkName: process.argv[2], apkUrl: process.argv[3], channel: process.argv[4]}, null, 2))' \ + "$tag" "$name" "$base/$channel/$name" "$channel" > "$out/$channel/latest.json" # PLG_SKIP_OTHER=1 is for the very first deploy, when the site does not exist # yet and the domain answers 403 (Cloudflare error 1014) instead of 404. @@ -47,13 +48,12 @@ fi if [ "$code" = 404 ]; then echo "No $other channel published yet; skipping." rm -rf "$out/$other" -elif [ "$code" = 200 ] && ! jq -e .apkName "$out/$other/latest.json" >/dev/null 2>&1; then +elif [ "$code" = 200 ] && ! other_name="$(node -p 'const j = JSON.parse(require("fs").readFileSync(process.argv[1], "utf8")); if (!j.apkName) process.exit(1); j.apkName' "$out/$other/latest.json" 2>/dev/null)"; then # A 200 that is not our JSON: Pages without a 404.html answers unknown paths # with index.html. Nothing is published on that channel. echo "No $other channel published yet (200 but no latest.json); skipping." rm -rf "$out/$other" elif [ "$code" = 200 ]; then - other_name="$(jq -er .apkName "$out/$other/latest.json")" curl -fsS -o "$out/$other/$other_name" "$base/$other/$other_name" cp "$out/$other/$other_name" "$out/$other/ProLibertateGames.apk" else