INNER CODE UNIT · Python
previous_job_count
wolfSSL/wolfssl-examples · .github/scripts/ci_triage.py:516
def previous_job_count():
"""Baseline for the circuit breaker: the last COMPLETED nightly's job count."""
try:
runs = gh(
f"/repos/{REPO}/actions/workflows/nightly.yml/runs"
f"?status=completed&per_page=2"
).get("workflow_runs", [])
for r in runs:
if str(r["id"]) != str(RUN_ID):
return len(all_jobs(r["id"]))
except Exception:
pass
return 0
def run_url():
return f"https://github.com/{REPO}/actions/runs/{RUN_ID}"