From 1a235a171dce21e5cebfc425318b91970164911a Mon Sep 17 00:00:00 2001 From: kjh2064 Date: Sun, 12 Jul 2026 23:36:42 +0900 Subject: [PATCH] fix(ci): paginate upstream ci lookup --- .gitea/workflows/deploy-prod.yml | 35 +++++++++++++++++--------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/.gitea/workflows/deploy-prod.yml b/.gitea/workflows/deploy-prod.yml index 44290282..0993c24e 100644 --- a/.gitea/workflows/deploy-prod.yml +++ b/.gitea/workflows/deploy-prod.yml @@ -132,23 +132,26 @@ jobs: print("✓ Workflow dispatch mode — upstream CI validation skipped") sys.exit(0) - url = f"https://gitea.taxbaik.com/api/v1/repos/{repo}/actions/runs?limit=20" - req = urllib.request.Request(url, headers={"Authorization": f"token {token}"}) - with urllib.request.urlopen(req, timeout=30) as resp: - payload = json.load(resp) - matched_ci = None - for run in payload.get("workflow_runs", []): - path = str(run.get("path") or "") - if "ci.yml@" not in path: - continue - if run.get("status") != "completed" or run.get("conclusion") != "success": - continue - actual_sha = str(run.get("head_sha") or "") - if actual_sha != expected_sha: - continue - matched_ci = run - break + for page in range(1, 6): + url = f"https://gitea.taxbaik.com/api/v1/repos/{repo}/actions/runs?limit=50&page={page}" + req = urllib.request.Request(url, headers={"Authorization": f"token {token}"}) + with urllib.request.urlopen(req, timeout=30) as resp: + payload = json.load(resp) + + for run in payload.get("workflow_runs", []): + path = str(run.get("path") or "") + if "ci.yml@" not in path: + continue + if run.get("status") != "completed" or run.get("conclusion") != "success": + continue + actual_sha = str(run.get("head_sha") or "") + if actual_sha != expected_sha: + continue + matched_ci = run + break + if matched_ci: + break if not matched_ci: print("ERROR: No successful ci.yml run found for the release SHA")