From 19f50e25fce37d858a893be49e7396553541fb61 Mon Sep 17 00:00:00 2001 From: peptiderepo-ops Date: Sat, 24 Oct 2026 11:05:04 +0000 Subject: [PATCH] fix(deploy-health): read other repos' main anonymously; never crash on a lookup Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01AqpXh3hQMMaC74pTjFq4it --- .gitea/workflows/deploy-health.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/deploy-health.yml b/.gitea/workflows/deploy-health.yml index 6385dfd..5f7cc21 100644 --- a/.gitea/workflows/deploy-health.yml +++ b/.gitea/workflows/deploy-health.yml @@ -36,7 +36,12 @@ jobs: problems="" for row in $(python3 -c 'import json; d=json.load(open("tools/gitea-pipeline/repos.json")); [print(k+"="+v["target_path"]) for k,v in d.items() if not k.startswith("_") and v.get("target_path")]'); do repo=${row%%=*}; tp=${row#*=}; slug=$(printf '%s' "$tp" | tr '/' '_') - head=$(curl -s -H "$H" "$API/repos/peptide-repo/$repo/branches/main" | python3 -c 'import json,sys;print(json.load(sys.stdin)["commit"]["id"])') + # The job token is scoped to peptide-e2e; the repos are public, so read + # their branches anonymously. Unreadable main = a problem, not a crash. + head=$(curl -s "$API/repos/peptide-repo/$repo/branches/main" | python3 -c 'import json,sys + try: print(json.load(sys.stdin)["commit"]["id"]) + except Exception: print("")') + if [ -z "$head" ]; then problems="$problems\n- $repo: could not read main from Gitea"; continue; fi stamp=$(ssh $SSHOPT "$SSH_USERNAME@$SSH_HOST" "cat ~/.peptide-deploys/production/$slug 2>/dev/null" || true) dep=${stamp%% *} if [ -z "$dep" ]; then