Webhook icon
Flow icon
Script icon
Get icon
If icon
Fetch icon
Set icon
Log icon

CI/CD Failure Diagnosis for GitHub Actions and Kestra

Diagnose GitHub Actions and Kestra failures with automated log analysis, error classification, redaction, and actionable reports.

Categories
Infrastructure

Diagnose GitHub Actions and Kestra failures in company.cicd. The flow normalizes events, avoids duplicates, retrieves logs, redacts secrets, classifies causes, and generates a Markdown report. AI explanations are advisory; commands are never executed.

How it works

  1. A Webhook receives GitHub Actions workflow_run or workflow_job events.
  2. An optional Flow trigger listens for failed executions in company.cicd.
  3. Python normalizes the event and a key-value lookup checks for duplicates.
  4. The flow retrieves logs, redacts common secret patterns, classifies errors, and optionally requests an AI explanation.
  5. A Markdown report is saved and the event key is retained for seven days.

What you get

  • A report with event details, probable cause, evidence, and next steps.
  • Rules for dependency, test, configuration, authentication, network, build, and resource errors.
  • Optional AI explanations, duplicate handling, redaction, and retries for transient GitHub API failures.

Who it's for

  • Platform and DevOps engineers, GitHub Actions maintainers, and Kestra operators.

Why orchestrate this with Kestra

Kestra coordinates event intake, branching, log retrieval, retries, and state tracking. Declarative tasks are observable, secrets are configured centrally, and deterministic rules work without AI.

Prerequisites

  • Kestra 2.0, required plugins, and network access to GitHub and the optional AI endpoint.
  • A GitHub repository and Actions workflow for GitHub log retrieval.
  • A GitHub token with Actions read permission for the target repository.

Secrets

  • CI_DIAGNOSIS_WEBHOOK_KEY: Authenticates webhook requests.
  • GITHUB_TOKEN: Reads Actions jobs and logs in the target repository.
  • ai_api_key: Optional SECRET-type input for the AI endpoint.

Quick start

  1. Configure the webhook secret and GitHub token in Kestra.
  2. Import the flow and execute it manually with the example event.
  3. Confirm ci-failure-diagnosis.md is generated and inspect its evidence.
  4. Configure a GitHub webhook for completed workflow_run or workflow_job events using application/json.
  5. Test a real failure before enabling triggers; check namespace scope and recursion prevention.

How to extend

  • Send reports to Slack or incident management.
  • Add repository-specific failure signatures and runbook links.
  • Store reports for trend analysis and escalate repeated failures.

Links

Share this Blueprint
See How

New to Kestra?

Use blueprints to kickstart your first workflows.