Automationprompt onlyMedium

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.

← all loops
automationgithub-actionsci-cddebuggingworkflowdevops

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.

  1. 01

    Check Workflow Runs

    Run 'gh run list' to see the latest workflow execution statuses

  2. 02

    Inspect Failed Workflows

    For any failed runs, examine logs and error messages to identify root causes

  3. 03

    Apply Fixes

    Make necessary code or configuration changes to address the identified failures

  4. 04

    Commit Changes

    Commit fixes with descriptive messages and push to trigger new workflow runs

  5. 05

    Monitor Progress

    Repeat checking until all workflows pass or iteration limit is reached

Workflow Steps

  1. 01

    Check Workflow Status

    Execute 'gh run list' to retrieve current GitHub Actions run statuses and identify any failures

  2. 02

    Analyze Failure Details

    For failed workflows, review logs, error messages, and context to determine the cause

  3. 03

    Implement Fix

    Modify relevant source code, scripts, or workflow configurations based on analysis

  4. 04

    Commit and Push

    Stage changes, create a commit with explanatory message, and push to origin branch

  5. 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

rendering…

Related loops — Automation