Codex CI Autofix Loop (Fix Failing GitHub Actions)
An event-triggered loop where a red GitHub Actions build invokes `codex exec` non-interactively with the failing logs and repo, and Codex proposes a fix as a PR or patch artifact — one bounded iteration per CI failure.
Implementation note
When to use: repetitive CI failures — lint drift, snapshot updates, simple breakages — where a competent first-pass fix attempt on every red build would save real triage time. How it works: a CI job triggers on workflow failure and runs codex exec non-interactively with the failing logs and the repo as context; Codex generates a fix and proposes it as a PR or a patch artifact. Because codex exec runs one task and exits, each CI failure is one bounded iteration — the event is the trigger, so there is no long-running process to babysit. Safety: the rail is stated plainly in the source guidance: configure it to propose a PR, never auto-merge — every fix must land through human review, and an auto-merge variant of this loop is unsafe. The one-shot-per-failure structure also self-limits spend. Watch the early PRs for fix quality before trusting the pattern on subtle failures.
More ci loops
Ship a PR through CI and reviews
Draft a PR, run CI, collect reviews, merge, and release—repeat every 30 minutes until land criteria are met.
Watch PR checks pass
Poll GitHub PR checks every 5 minutes until all status checks pass.
Wait for CI so you don't have to
Poll gh pr checks every 10 minutes and get told when the PR is ready to merge, or a summary of which checks failed and why.