fix(ci): paginate upstream ci lookup
This commit is contained in:
@@ -132,12 +132,13 @@ jobs:
|
|||||||
print("✓ Workflow dispatch mode — upstream CI validation skipped")
|
print("✓ Workflow dispatch mode — upstream CI validation skipped")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
url = f"https://gitea.taxbaik.com/api/v1/repos/{repo}/actions/runs?limit=20"
|
matched_ci = None
|
||||||
|
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}"})
|
req = urllib.request.Request(url, headers={"Authorization": f"token {token}"})
|
||||||
with urllib.request.urlopen(req, timeout=30) as resp:
|
with urllib.request.urlopen(req, timeout=30) as resp:
|
||||||
payload = json.load(resp)
|
payload = json.load(resp)
|
||||||
|
|
||||||
matched_ci = None
|
|
||||||
for run in payload.get("workflow_runs", []):
|
for run in payload.get("workflow_runs", []):
|
||||||
path = str(run.get("path") or "")
|
path = str(run.get("path") or "")
|
||||||
if "ci.yml@" not in path:
|
if "ci.yml@" not in path:
|
||||||
@@ -149,6 +150,8 @@ jobs:
|
|||||||
continue
|
continue
|
||||||
matched_ci = run
|
matched_ci = run
|
||||||
break
|
break
|
||||||
|
if matched_ci:
|
||||||
|
break
|
||||||
|
|
||||||
if not matched_ci:
|
if not matched_ci:
|
||||||
print("ERROR: No successful ci.yml run found for the release SHA")
|
print("ERROR: No successful ci.yml run found for the release SHA")
|
||||||
|
|||||||
Reference in New Issue
Block a user