GitHub Actions Tools · Open Source

Self-Healing CI/CD: How Naoru Fixes Broken Pipelines

TL;DR

  • A red build costs time before anyone writes a fix: someone has to read the logs and work out what broke. Naoru does that first pass for you.
  • It reads the failed job's log and the pull request diff, scrubs secrets, asks the LLM you choose, and posts one comment with the root cause, a suggested fix and a confidence level.
  • It is free and open source (Apache 2.0). It runs as a GitHub Action, or as a Docker image for GitLab, Jenkins and local runs. It always exits 0, so it never breaks your build.
  • By default it only suggests. Auto-fix is experimental and opt-in. A human still reviews and merges every change.
Naoru, self-healing CI/CD: a failed pipeline, its logs and diff read by AI, and the root cause and fix posted on the pull request. CloudDrove

Every team knows this moment. You push a change, the pipeline goes red, and now someone has to open the job, scroll through hundreds of log lines and work out what actually broke. Sometimes it is a real bug. Sometimes it is a flaky test (a test that fails now and then for no clear reason). Sometimes the deploy step failed because of a config change three commits back.

The fix is often small. Finding it is the slow part. And in most teams it is the same person who does this every time, usually the one who knows the pipeline best.

We built Naoru to take that first pass off their plate. This post explains what it does, step by step, how to try it with the commands from its README, and, just as important, what it does not do.

The problem: a red build is a tax on your best engineer

A failed pipeline blocks a merge, a release or a hotfix. The person who looks at it has to do three things before any code changes: find the failed job, read the log, and connect the error to what changed in the pull request. That last step is the one that takes experience. An error like "cannot read properties of undefined" means little until you see which line the PR changed.

This is exactly the kind of work an AI model is good at as a first draft: reading a lot of text and pointing at the likely cause. It is also the kind of work where it should not have the final say. Naoru is built around both of those ideas.

What Naoru is

Naoru is a free, open-source tool from CloudDrove, under the Apache 2.0 license. The name comes from the Japanese word for "to be fixed" or "to heal". When a pipeline fails, it reads the logs and your PR diff, finds the root cause, and comments the fix on your pull request. The code is on GitHub.

Root cause, not noise

Reads the failed job's log together with the PR diff, so the fix points at your real change, not a generic guess.

One sticky comment

Updates the same PR comment on every re-run, so the PR does not fill up with copies.

Works without a PR

On manual or scheduled runs, the diagnosis goes to the job's Step Summary instead. Useful for Terraform deploy and drift pipelines.

Your choice of LLM

Anthropic, OpenAI, Gemini, OpenRouter, xAI or Groq, or any OpenAI-compatible endpoint, including your own model.

Runs anywhere

A GitHub Action, or a Docker image for GitLab docker-in-docker, Jenkins and your laptop.

Never breaks your build

The diagnosis is comment-only and always exits 0. If Naoru itself fails, you get a warning, not a red pipeline.

So where does "self-healing" come in? Out of the box, Naoru heals by telling you what to fix. If you want it to go further, an experimental auto-fix mode can post one-click suggestions or open a separate fix PR. We cover that, and its safety rails, below.

How it works, step by step

Here is what happens in a GitHub Actions workflow, from red build to comment.

This is the example comment from the README. The diagnosis names the file and line, shows the fix and says how sure it is.

## naoru
Failed job: build

Root cause: Type error in src/auth.ts:42, user is possibly undefined.

Suggested fix:
- if (user.id)
+ if (user?.id)

Confidence: High

Naoru works with seven provider settings. Anthropic is called natively. Everything else goes through the OpenAI-compatible API.

AnthropicanthropicThe default provider
OpenAIopenaiOpenAI-compatible API
GeminigeminiOpenAI-compatible API
OpenRouteropenrouterOpenAI-compatible API
xAI (Grok)xaiOpenAI-compatible API
GroqgroqOpenAI-compatible API
Your own modelcustomAny OpenAI-compatible endpoint, set with base-url

Try it in three steps

These steps come straight from the README. You need a GitHub repo with a workflow and an API key from one of the providers above.

Step 1. Store your LLM key as a repository secret. Never put it in the YAML file. You can use the GitHub UI (Settings, then Secrets and variables, then Actions) or the GitHub CLI:

$ gh secret set ANTHROPIC_API_KEY --repo your-org/your-repo
# paste the key when prompted

Step 2. Add a naoru job to your workflow. It runs only when your build job fails. The permissions block is required: without actions: read it cannot fetch logs, and without pull-requests: write it cannot comment.

# .github/workflows/ci.yml
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - run: make build          # your real build/test job

  naoru:
    needs: [build]
    if: ${{ always() && needs.build.result == 'failure' }}
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: write       # post the comment
      actions: read              # read the failed run's logs
    steps:
      - uses: clouddrove/naoru@v0
        with:
          api-key: ${{ secrets.ANTHROPIC_API_KEY }}
          provider: anthropic

Step 3. Open a PR and let a job fail. On the next failing run, Naoru posts its comment with the root cause and a suggested fix.

Not on GitHub Actions? The same engine ships as a Docker image. Pipe a failed build log into it and it prints the diagnosis. Give it --repo, --pr and a GITHUB_TOKEN, and it also posts the PR comment.

$ cat build.log | docker run -i \
    -e NAORU_API_KEY=$LLM_KEY \
    -e NAORU_PROVIDER=anthropic \
    ghcr.io/clouddrove/naoru:latest

The repo also has a GitLab CI example and a "watcher" workflow that watches every other workflow in the repo. The watcher writes to the Step Summary only, with no PR comment and no auto-fix.

Auto-fix: the experimental part

Naoru can go beyond a diagnosis if you opt in with the fix-mode setting. The README marks this as experimental, and so do we.

offThe default

Diagnosis only. One comment with the root cause and the suggested fix. Nothing in your code changes.

pull-requests: write

suggestOne click, by a human

Posts GitHub suggestion comments on the PR, one per change. A developer still has to click to apply each one.

pull-requests: write

prA separate fix PR

Applies the fix on a new naoru/fix branch and opens a PR into your failing branch. It never pushes to your branch.

contents: write, pull-requests: write

The safety rails are always on. Auto-fix only acts on high-confidence diagnoses that include a diff. It caps a patch at 300 changed lines and refuses unclear changes rather than guessing. It never touches files that run during checkout, install or build, such as .github/, Dockerfile, Makefile, .npmrc and shell scripts, and you can add more with protected-paths. It skips its own fix branches, so a broken fix cannot loop. And if anything in the fix step fails, the diagnosis still ships and your pipeline is not blocked.

What Naoru does not do

An honest tool page lists the limits too. Here is what you should not expect.

It is not a flaky test tool

It looks at one failed run at a time. It does not re-run tests, quarantine them or track which tests fail on and off.

It does not change code by default

Auto-fix is off unless you turn it on, and even then it never pushes to your branch or merges.

Your data does leave the runner

The log tail and the PR diff go to the LLM provider you set, after secret scrubbing. Choose the provider with that in mind.

It is not always right

Every diagnosis carries a confidence level for a reason. It sees only the log tail and the diff, not your whole system.

How to use it safely

Treat Naoru like a fast junior teammate who reads logs very quickly: useful, but you review the work. This is how we set it up.

  • A human reviews every suggestion and every fix PR before merge, with your normal branch protection and required checks.
  • Start with fix-mode off. Move to suggest once the team trusts the diagnoses. Use pr last, if at all.
  • Never use fix-mode on pull_request_target for PRs from forks. Use the pull_request trigger.
  • Keep the API key in Actions secrets, and give the job only the permissions in the README.
  • Add your own secret shapes and internal hostnames to redact-patterns.
  • Pick a provider your data policy allows, or use custom with your own model endpoint.
  • Add package.json to protected-paths if you do not want auto-fix to change dependency versions.
  • Watch the token count on each comment, and keep max-log-lines modest to control cost.

If you are tightening the rest of your pipeline too, our post on the GitHub Actions and Argo CD pipeline we ship by default shows how we keep cluster credentials out of CI.

Quick answers

Is Naoru free?

Yes. Naoru is open source under the Apache 2.0 license, with no signup. You pay only for the LLM calls, with your own API key from the provider you choose. Each diagnosis is one LLM call, and Naoru reports the tokens it used.

Does Naoru send my code to an AI provider?

It sends the tail of the failed job's log (500 lines by default) and the pull request diff to the LLM provider you configure. Before that, it scrubs common secret shapes such as private keys, JWTs, bearer headers, cloud and GitHub tokens and credentials in connection strings. You can add your own patterns, or point it at your own OpenAI-compatible model endpoint.

Can Naoru fix flaky tests?

Not as a flaky test tool. Naoru looks at one failed run at a time. It explains what that log and diff show, but it does not re-run tests, quarantine them or track which tests fail on and off across many runs.

Does Naoru work outside GitHub Actions?

Yes. The same engine ships as a Docker image, ghcr.io/clouddrove/naoru, that reads a failed log from a file or standard input and prints the diagnosis. The README names GitLab CI with docker-in-docker, Jenkins and local runs, and includes a GitLab example. With a GitHub token, repo and PR number it can also post the PR comment.

What to do next

01

Add Naoru to one repo this week. Pick the repo with the most red builds, follow the three steps above and see what the first few comments look like. Start on the Naoru page or go straight to the GitHub repo.

02

Fix the pipeline itself. Our GitHub Actions consulting designs, fixes and secures workflows using our open-source shared workflows.

03

Make every change tested and reversible. Our CI/CD and GitOps service builds pipelines where every change is reviewed and easy to roll back.

04

See the rest of our tools. Browse our open-source tools, like Smurf and SyncerD, or talk to an engineer.

A red build should cost you a review, not an afternoon.

Sources

  1. naoru README, github.com/clouddrove/naoruFeatures, setup steps, workflow YAML, Docker usage, provider list, secret redaction, auto-fix modes and safety rails, cost and fail-safe behavior.
  2. examples/watcher.yml, github.com/clouddrove/naoruThe watcher workflow and its limits: Step Summary only, no PR comment, no fix-mode.
  3. naoru releases, github.com/clouddrove/naoruRelease history of the action.
  4. Naoru, clouddrove.comWhat Naoru is, why we built it, Apache 2.0 license and fail-safe design.
All blogs

Related Reading

Go deeper.

Cloud Infrastructure Assessment

See exactly where your cloud stands.

A senior engineer reviews your architecture, cost, security, and reliability, then sends back a prioritized findings report, the fixes that matter most, in order.

  • Architecture & scale
  • Cost & efficiency
  • Security & reliability
Book an Assessment

Complimentary · no obligation · no sales pressure

Work With Us

Want this kind of engineering on your side?

The same people who write these build your platform. Let's talk about what you're working on.

Talk to an Expert