diff --git a/scripts/send-post.sh b/scripts/send-post.sh index 6511f01..7ee2fbc 100755 --- a/scripts/send-post.sh +++ b/scripts/send-post.sh @@ -32,9 +32,9 @@ export GOCACHE=${GOCACHE:-$realhome/.cache/go-build} read -r want reviewed < <(python3 -c ' import sys, yaml d = yaml.safe_load(open(sys.argv[1])) -print(d["channel"], d["request"].get("reviewed_by") or "-")' "$post") -[ "$want" = "$channel" ] || { echo "post is for channel '$want', not '$channel'" >&2; exit 2; } -[ "$reviewed" != "-" ] || { echo "request.reviewed_by is empty; a person reviews before sending" >&2; exit 2; } +r = str(d.get("reviewed_by") or "").strip() +print(d["channel"], r if r and not r.startswith("<") else "-")' "$post") +[ "$reviewed" != "-" ] || { echo "reviewed_by is not signed; a person reviews and signs before sending" >&2; exit 2; } TELEGRAM_CHANNEL_ID=$(go run ./cmd/provision adapter-config --spec "$spec" --channel "$channel" \ | sed -n 's/^TELEGRAM_CHANNEL_ID=//p') @@ -56,6 +56,7 @@ import json, os, subprocess, sys, yaml post, channel, tmp, hall, forge = sys.argv[1:] d = yaml.safe_load(open(post)) req = d["request"] +req["reviewed_by"] = str(d["reviewed_by"]).strip() # the file's sign-off is the review if not req.get("visual_url"): cmd = [f"{tmp}/compose", "visual", "--hall-dir", hall, "--hall-raw-base", f"{forge}/hall-of-helix/raw/branch/main",