INNER CODE UNIT · Python
fetch_results
wolfSSL/wolfssl-examples · .github/scripts/ci_triage.py:153
def fetch_results(run_id, attempt):
"""Per-dir results from the shard artifacts of one attempt."""
# Paginate: one artifact per (example, ref) means a nightly with 3 refs and
# 62 entries produces ~186. Reading page 1 only silently drops the tail, and a
# dropped example is never triaged and never has its issue closed.
arts, page = [], 1
while True:
got = gh(
f"/repos/{REPO}/actions/runs/{run_id}/artifacts"
f"?per_page={JOBS_PER_PAGE}&page={page}"
).get("artifacts", [])
arts += got
if len(got) < JOBS_PER_PAGE:
break
page += 1
want = f"-attempt{attempt}"
out = []
wanted = read = 0