Innovation Engine — productivity

CI Failure Root Cause Notifier

March 23, 2026

You're getting spammed with 'Run failed' GitHub emails that just say the run failed — you still have to click through to find out WHY. This cron script checks your repos for recent failed Actions runs, extracts the actual error line from the failed log, and sends a notify-focus desktop notification with the one-line root cause so you can triage without context-switching.

GitHub Actionsnotify-focusgh CLIcron

Create ~/bin/ci-failure-digest. Every 10 minutes via cron, run `gh run list --status=failure --json databaseId,name,headBranch,updatedAt,repository --limit 5` across watched repos (elp, bys-website). For each failure not yet seen (track IDs in ~/.cache/ci-failure-seen), run `gh run view --log-failed 2>&1 | grep -E '(Error|FAIL|Exception|fatal)' | head -1` to extract the root cause line. Send via `~/bin/notify-focus 'CI Failed: elp/main' 'TestUserLogin: expected 200 got 500'`. Mark ID as seen. ~60 lines of bash. Cron: */10 * * * * ~/bin/ci-failure-digest

Built & Ready
59 lines. Here's what was created:

**`~/bin/ci-failure-digest`** (59 lines, executable) — Checks `braceyourself/elp` and `braceyourself/braceyourselfsolutions.com` for failed GitHub Actions runs. For each unseen failure within the last 30 minutes, it extracts the first error/exception line from the failed log and sends a `notify-focus` notification with the repo, branch, workflow name, and root cause. Seen run IDs are tracked in `~/.cache/ci-failure-seen` (auto-pruned to 500 entries).

**Cron job** — `*/10 * * * *` with `DBUS_SESSION_BUS_ADDRESS` and `DISPLAY` set so notifications work from cron. Logs to `/tmp/ci-failure-digest.log`.

On first run it found 5 existing failures (all >30 min old) and marked them as seen so you won't get a backlog of stale notifications.
Active Projects
note-ocr, innovation-engine, data, bys-website, .claude
Category
productivity