Skip to content

fix(ci): rerun the newest failed run for a sha, not the newest run - #6

Merged
matthewtsmith merged 1 commit into
mainfrom
fix/ci-rerun-failed-run
Oct 15, 2026
Merged

matthewtsmith merged 1 commit into
mainfrom
fix/ci-rerun-failed-run

Conversation

@matthewtsmith

Copy link
Copy Markdown
Member

What changed

rerunFailedChecks (src/github.ts) now queries actions/runs?head_sha=<sha>&status=failure&per_page=1 instead of the newest run of any status.

Why

On apptrade PR #573 the newest run for the head sha was a skipped E2E run, not the failed drift run. Rerunning it returned HTTP 403 "This workflow run cannot be retried". The error was thrown before the ledger comment was written, so ciRerunCount stayed 0 and every tick retried the same 403 with growing backoff.

How it was tested

  • pnpm test: 598/598
  • pnpm run typecheck: clean
  • Confirmed against the GitHub API that per_page=1 without a status filter returned the skipped run for that sha.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DL7BBw37FuBwVdPDMFT4MD

rerunFailedChecks asked for the newest workflow run on the head commit.
That is often a skipped or green workflow, and rerunning one is a 403
("This workflow run cannot be retried"). The 403 threw before the ledger
line was written, so the daemon retried it every tick with backoff and
never reached the builder fix round. Filter the query on status=failure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DL7BBw37FuBwVdPDMFT4MD
@matthewtsmith
matthewtsmith merged commit 3e48b43 into main Oct 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant