Workflow Until Zero Failures
This loop automates the process of identifying, fixing, and resolving CI/CD workflow failures. It continuously monitors GitHub Actions workflow runs, inspects failure logs, applies targeted fixes, and re-runs workflows until all pass or maximum iterations are reached.
Goal
Fix workflow failures
How to Run
Paste this loop into your agent (Cursor, Claude Code, Codex, etc.) to automatically resolve GitHub Actions workflow failures through iterative inspection and repair.
- 01
Check Workflow Runs
Run 'gh run list' to see the latest workflow execution statuses
- 02
Inspect Failed Workflows
For any failed runs, examine logs and error messages to identify root causes
- 03
Apply Fixes
Make necessary code or configuration changes to address the identified failures
- 04
Commit Changes
Commit fixes with descriptive messages and push to trigger new workflow runs
- 05
Monitor Progress
Repeat checking until all workflows pass or iteration limit is reached
Workflow Steps
- 01
Check Workflow Status
Execute 'gh run list' to retrieve current GitHub Actions run statuses and identify any failures
- 02
Analyze Failure Details
For failed workflows, review logs, error messages, and context to determine the cause
- 03
Implement Fix
Modify relevant source code, scripts, or workflow configurations based on analysis
- 04
Commit and Push
Stage changes, create a commit with explanatory message, and push to origin branch
- 05
Wait and Recheck
Pause briefly for workflows to execute, then re-run 'gh run list' to verify fixes
Kickoff Prompt
Start the "Workflow Until Zero Failures" loop. Goal: Fix workflow failures Max iterations: 10 Between iterations run: gh run list Exit when: Workflow succeeds Start by running 'gh run list' to check the most recent GitHub Actions workflow runs. Identify any failed workflows, inspect their logs to determine the underlying issues, and apply targeted fixes. After each fix, commit your changes and push them to trigger new workflow runs. Continue this cycle until all workflows pass successfully or you reach 10 iterations. Self-pace this loop. After each iteration, run `gh run list` and evaluate the output, and only continue if the exit condition is not met (Workflow succeeds). Stop when the exit condition passes or 10 iterations are reached. Give a short status update each pass.
Guardrails
hardcoded- ·Only make changes to code or configuration files that directly relate to fixing workflow failures
- ·Do not exceed the maximum of 10 iterations
- ·Never expose or log sensitive information such as API keys or secrets
- ·Ensure all modifications stay within the repository scope
- ·Stop immediately if repository access or permissions are insufficient
Flow Diagram
Related loops — Automation
Automation
Release Automation Builder
This loop automates the entire software release process by creating and validating a CI/CD pipeline that builds, tests, and deploys your application. The agent will iteratively refine the release pipeline until it passes all checks, ensuring a robust and reliable deployment process.
Automation
Automate Repetitive Task
This loop identifies repetitive manual tasks in a project and automatically generates automation scripts to replace them. The agent iteratively analyzes workflows, creates optimized scripts, validates their effectiveness, and refines until all targeted manual steps are eliminated.
Automation
Ticket Auto-Triage
Automatically analyze and label unlabeled issues in a GitHub repository to improve organization and streamline development workflows.