Compare commits
1 Commits
7e1fb898e3
...
fix/pr-ci-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a4cbd4be51 |
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user