Schedule icon
Webhook icon
Loop icon
Request icon
Script icon
If icon
SlackIncomingWebhook icon
OutputValues icon

Triage Flaky GitHub Actions Workflows with Slack Digests

Triage GitHub Actions CI health with Kestra. Detect flaky workflows in a lookback window and alert Slack.

Categories
CoreInfrastructure

Stop flaky CI from silently slowing every merge. This blueprint polls the GitHub Actions API across a configurable repo list every weekday morning, filters runs to a lookback window (default 24h), counts failures per workflow, and posts a Slack digest only when a workflow fails at least fail_threshold times, the classic flaky signal. A webhook trigger enables on-demand triage right after a bad merge.

How it works

  1. weekday_mornings (Schedule, 0 8 * * 1-5) launches the scan; on_demand_webhook allows ad-hoc runs.
  2. scan_repositories (Loop, concurrency 3) fans out across inputs.repositories.
  3. fetch_runs (http.Request) calls GET /repos/{repo}/actions/runs?per_page=50 with GITHUB_TOKEN bearer auth.
  4. triage_runs (Python Script) filters to the lookback window, tallies failure / timed_out / cancelled conclusions per workflow, and flags offenders at fail_threshold.
  5. alert_on_offenders (If on breached) posts run links to Slack; quiet otherwise.
  6. emit_ci_metrics (OutputValues) exports scan coverage.

What you get

  • Multi-repo CI health scan in one flow.
  • Repeat-offender detection (default 2+ failures in 24h) instead of single-failure noise.
  • Slack digest with workflow names, branches, and deep links to failing runs.
  • Tunable lookback window per team cadence.

Who it's for

  • Platform and DX teams owning CI reliability.
  • Engineering managers tracking flaky-test burden.
  • Open-source maintainers triaging nightly CI.

Prerequisites

  • GitHub personal access token with actions:read on target repos.
  • Slack Incoming Webhook URL.

Secrets

  • GITHUB_TOKEN: token for the Actions runs API.
  • SLACK_WEBHOOK_URL: Slack digest destination.
  • WEBHOOK_KEY: webhook trigger auth key.

Quick start

  1. Set the three secrets above.
  2. Edit repositories, lookback_hours, fail_threshold.
  3. Run manually to verify API access.
  4. Leave the weekday schedule enabled.

How to extend

  • Write failures to Postgres to track flake rate over time.
  • Auto-open GitHub issues for offenders failing 5+ times.
  • Split alerts by team via repo-to-channel mapping.

Links

Inputs

  • repositories (ARRAY of STRING): owner/repo list.
  • lookback_hours (INT, default 24): window for failure counting.
  • fail_threshold (INT, default 2): failures to flag a workflow.

Outputs

  • outputs.triage_runs.vars.failure_count: failures in window per repo.
  • emit_ci_metrics.values.scanned_at: scan timestamp.
See How

New to Kestra?

Use blueprints to kickstart your first workflows.