CI Until Green
This loop continuously monitors and fixes CI issues until all checks pass. It runs the 'gh pr checks' command iteratively, analyzes failures, and applies fixes until the exit condition is met.
Goal
All CI checks pass
How to Run
Run this loop to automatically resolve CI failures in your pull request until all checks are green.
- 01
Confirm Pull Request Readiness
Ensure you're on the correct branch and have an open pull request with pending checks.
- 02
Execute Check Command
Run 'gh pr checks' to get the current status of all CI checks.
- 03
Analyze Failures
If checks fail, examine the output to identify root causes and necessary code changes.
- 04
Apply Fixes
Modify code or configuration based on identified issues. Commit and push changes to the PR.
- 05
Repeat Until Green
Continue the cycle until all checks pass or max iterations are reached.
Workflow Steps
- 01
Run 'gh pr checks' command to assess CI status
- 02
Parse output to determine if exit condition is met
- 03
If checks are failing, inspect logs and error messages
- 04
Identify specific code changes needed to fix failures
- 05
Create commits with fixes and push to trigger new CI runs
Kickoff Prompt
Start the "CI Until Green" loop. Goal: All CI checks pass Max iterations: 10 Between iterations run: gh pr checks Exit when: CI green You are an autonomous coding agent focused on resolving CI failures. Begin by running 'gh pr checks' to evaluate the current state of the pull request's CI pipeline. Based on the results, analyze any failed checks, determine the root cause, and apply the necessary fixes to the codebase. Continue this process of checking, analyzing, and fixing until all CI checks pass (exit condition: 'CI green') or you reach the maximum of 10 iterations. Prioritize efficiency and correctness in your fixes. Self-pace this loop. After each iteration, run `gh pr checks` and evaluate the output, and only continue if the exit condition is not met (CI green). Stop when the exit condition passes or 10 iterations are reached. Give a short status update each pass.
Guardrails
hardcoded- ·Do not make changes to production code without understanding implications
- ·Stop execution after 10 iterations to prevent infinite loops
- ·Only address CI-related issues, not general code improvements
Flow Diagram
Related loops — CI
CI
Dependency Cache Optimizer
Automatically analyzes cache metrics, identifies dependency-related bottlenecks, and optimizes caching strategy to improve cache hit rates in CI environments.
CI
Flaky Test Hunter
This loop automatically identifies and removes flaky tests in your Node.js project. A flaky test is one that passes and fails intermittently without any code changes. The agent will run your test suite multiple times, detect inconsistent test results, and attempt to fix or remove the flaky tests to stabilize your CI pipeline.
CI
Parallelize CI Jobs
This loop optimizes CI pipeline efficiency by identifying and parallelizing independent jobs to reduce overall runtime. The agent iteratively analyzes the current pipeline structure, implements parallelization strategies, and validates improvements through metrics.