Skip to main content
You can use Unpage to automatically diagnose and fix many common build and deployment issues, from dependency conflicts to test failures to configuration errors. Instead of manually digging through logs and debugging, your agent analyzes the failure, applies a fix using Claude Code Headless Mode, and opens a pull request for your review. This keeps humans in control of what gets merged while eliminating the tedious parts of build failure investigation. Your team stays unblocked, deployments resume faster, and engineers can focus on reviewing solutions rather than hunting for problems.

Example Build Failure

GitHub Actions Failure

Creating A GitHub Actions Build Failure Agent

Let’s create an Agent that runs every time we get a GitHub Actions build failure alert. Our Agent will extract the workflow and job details from the alert, fetch the failing job logs, analyze the specific error, use Claude Code to automatically fix the issue, and create a pull request with the fix. After installing Unpage, create the agent by running:
A yaml file will open in your $EDITOR. Paste the following Agent definition into the file:
Let’s dig in to what each section of the yaml file does:

Description: When the agent should run

The description of an Agent is used by the Router to decide which Agent to run for a given input. In this example we want the Agent to run only when the alert is about GitHub Actions workflow failures on main branches or releases, not pull request failures.

Prompt: What the agent should do

The prompt is where you give the Agent instructions, written in a runbook format. Make sure any instructions you give are achievable using the tools you have allowed the Agent to use (see below).

Tools: What the agent is allowed to use

The tools section explicitly grants permission to use specific tools. You can list individual tools, or use wildcards and regex patterns to limit what the Agent can use. To see all of the available tools your Unpage installation has access to, run:
In our example we added several custom shell commands for GitHub Actions diagnostics:
  • shell_get_last_failing_run
  • shell_fetch_run_logs
  • shell_noninteractive_claude_code_run
  • shell_commit_and_open_pull_request
These are custom shell commands that use the GitHub CLI (gh), Claude Code in Headless Mode, and standard git commands to interact with GitHub Actions and automate fixes. Custom shell commands allow you to extend the functionality of Unpage without having to write a new plugin.

Defining Custom Tools

To add our custom GitHub Actions analysis and automation tools, edit ~/.unpage/profiles/default/config.yaml and add the following:
Shell commands have full access to your environment and can run the GitHub CLI (gh) and git commands. Make sure you have the GitHub CLI installed and authenticated (gh auth login) and that the repository is cloned locally. See shell commands for more details.

Running Your Agent

With your Agent configured and the custom GitHub Actions automation tools added, we are ready to test it on a real PagerDuty alert.

Testing on an existing alert

To test your Agent locally on a specific PagerDuty alert, run:

Listening for webhooks

To have your Agent listen for new PagerDuty alerts as they happen, run unpage agent serve and add the webhook URL to your PagerDuty account:

Example Output

Your Agent will:
  • Extract the repository name from the alert
  • Query GitHub Actions for the most recent failing run ID using gh run list
  • Fetch complete logs from the failing run using gh run view --log
  • Use Claude Code to analyze the root cause and attempt an automated fix
  • Create a pull request with the automated fix (if successful) for human review
  • Provide detailed explanation of what was changed and why in the PR description
  • Stop and wait for human intervention if no automated fix could be applied
The Agent transforms a disruptive build failure into an automated investigation and fix attempt, creating a pull request for human review rather than automatically merging changes, ensuring code quality while dramatically reducing time to resolution.

Production Deployment

To deploy this agent to production, see our Deployment Guide.