INNER CODE UNIT · Python

rerun_and_wait

wolfSSL/wolfssl-examples · .github/scripts/ci_triage.py:87

def rerun_and_wait(run_id):
    before = int(gh(f"/repos/{REPO}/actions/runs/{run_id}").get("run_attempt", 1))
    try:
        gh(f"/repos/{REPO}/actions/runs/{run_id}/rerun-failed-jobs", method="POST")
    except urllib.error.HTTPError as e:
        # 403 = run too old / Actions disabled / "No failed jobs" (every non-pass
        # was `cancelled`, which this endpoint will not rerun). 409 = already running.
        return before, f"retry could not be started (HTTP {e.code})"
    except Exception as e:
        return before, f"retry could not be started ({type(e).__name__})"

    end = time.monotonic() + RETRY_DEADLINE_S
    seen = before
    while time.monotonic() < end:
        time.sleep(POLL_INTERVAL_S)
        try:
            run = gh(f"/repos/{REPO}/actions/runs/{run_id}")
        except Exception:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…