NewGitHub Action

Explain failing CI logs directly inside GitHub Actions

ExplainThisError CI reads the failing part of your build, test, or deploy logs and returns a clear root cause, detailed explanation, and concrete fixes. No changes to your existing commands – just one extra step.

Add via GitHub MarketplaceCopy example workflowWorks with any language / framework
What you get on failure
  • One-line root-cause summary in the CI step.
  • Expanded explanation for humans, not just stack traces.
  • Suggested fixes and commands to try next.
  • Optional PR comment with the full analysis.
  • JSON outputs you can wire into other steps.
For teams
Reduce time spent reading CI logs, especially on contributor pull requests and flaky tests.
For maintainers
Give contributors instant feedback on why CI is red and how to fix it, without writing custom docs for each error.
For solo devs
Keep CI as the single place you look when something breaks – with an explanation attached.

Drop-in workflow example

This job runs your tests, captures the last lines when they fail, and asks ExplainThisError CI to explain the failure and suggest fixes.

View action on GitHub →
name: ExplainThisError CI

on:
  push:
    branches: [ main ]
  pull_request:
  workflow_dispatch:

jobs:
  analyze:
    runs-on: ubuntu-latest

    permissions:
      contents: read
      pull-requests: write

    steps:
      - uses: actions/checkout@v4

      - name: Run tests
        id: test
        run: |
          set -o pipefail
          npm test --silent 2>&1 | tee test.log

      - name: Collect error
        if: failure()
        id: err
        run: |
          echo "error<<EOF" >> "$GITHUB_OUTPUT"
          tail -n 300 test.log >> "$GITHUB_OUTPUT"
          echo "EOF" >> "$GITHUB_OUTPUT"

      - name: ExplainThisError
        if: failure()
        id: explain
        uses: alaneldios/explainthiserror-action@v1
        with:
          error: ${{ steps.err.outputs.error }}
          api_key: ghci_public_free_1
          api_url: https://api.explainthiserror.com/ci/analyze
          comment_pr: true
          fail_on_api_error: false

      - name: Use ExplainThisError outputs
        if: failure()
        run: |
          printf 'Root cause: %s\n' "\${{ steps.explain.outputs.root_cause_short }}"
          printf 'Details:\n%s\n' "\${{ steps.explain.outputs.root_cause_detail }}"
For production/private repos, replace the demo key with a secret:api_key: \${ secrets.EXPLAINTHISERROR_API_KEY }

How ExplainThisError CI fits into your pipeline

1. Run
Your existing build, test, or deploy steps run as usual. You don't change any commands or flags.
2. Capture
On failure, you capture the last lines of the log into an error output using GITHUB_OUTPUT.
3. Explain
The ExplainThisError CI action sends that error text to the API, which returns a structured explanation and suggested fixes.
4. Surface
The action writes a concise summary into the step output and can post a PR comment so reviewers and contributors see it immediately.
Demo usage
For experiments, public repos, and small projects.
  • Use the built-in public key: ghci_public_free_1
  • Good for trials and occasional failures.
  • Subject to rate limits.
Team / production
For private repos, frequent CI runs, and team workflows.
  • Create an API key in your ExplainThisError account.
  • Store it as a secret (for example, EXPLAINTHISERROR_API_KEY).
  • Reference the secret in the action api_key input.
Turn your next red CI run into a clear explanation
Keep your existing workflows. Add one step. Get instant root-cause analysis.
Add via MarketplaceTry the analyzer in the browser