fix(mosaic-tools): roll up Gitea and Woodpecker wrapper fixes #524

Merged
jason.woltje merged 12 commits from fix/git-wrapper-rollup-20260526 into main 2026-05-26 20:56:10 +00:00
Showing only changes of commit e2d49aface - Show all commits

View File

@@ -30,12 +30,19 @@ EOF
# get_remote_host and get_gitea_token are provided by detect-platform.sh
extract_state_from_status_json() {
python3 - <<'PY'
# Capture piped JSON BEFORE invoking `python3 - <<PY`. The heredoc binds
# stdin to the Python program text — so json.load(sys.stdin) inside would
# try to re-read stdin after `-` already consumed it for the program,
# yielding EOF and returning "unknown" every time. Pass payload via env.
local payload
payload=$(cat)
PR_CI_STATUS_JSON="$payload" python3 - <<'PY'
import json
import os
import sys
try:
payload = json.load(sys.stdin)
payload = json.loads(os.environ.get("PR_CI_STATUS_JSON", ""))
except Exception:
print("unknown")
raise SystemExit(0)
@@ -66,12 +73,16 @@ PY
}
print_status_summary() {
python3 - <<'PY'
# Same stdin-collision fix as extract_state_from_status_json above.
local payload
payload=$(cat)
PR_CI_STATUS_JSON="$payload" python3 - <<'PY'
import json
import os
import sys
try:
payload = json.load(sys.stdin)
payload = json.loads(os.environ.get("PR_CI_STATUS_JSON", ""))
except Exception:
print("[pr-ci-wait] status payload unavailable")
raise SystemExit(0)