CI Auto-Fix

Automatically fix CI failures on your pull requests.

Overview

CI auto-fix is designed for validation failures that are visible from logs and can be corrected with a focused repository change.

CI auto-fix loop
01 Webhook event

Failure Event

A check run, pipeline, or status signal turns the branch red.

02 Diagnosis

Inspect Logs

Forkline gathers the failing context, logs, and likely reproduction clues.

03 Repair

Generate Fix

The agent changes code or configuration to address the root cause.

04 Feedback

Report Back

A follow-up commit or comment explains what changed.

CI auto-fix only starts after a provider reports a failed validation event on the branch.

Info: CI auto-fix requires webhook events for CI status such as check runs, pipeline events, or status updates.

Supported CI Sources

Forkline works with any CI system that reports the right webhook signals, including:

  • GitHub Actions
  • GitLab CI
  • Forgejo Actions
  • External CI systems that emit supported status events

Enabling CI Auto-Fix

  1. Navigate to Repositories
  2. Find your repository
  3. Click Settings on the repository card
  4. Select the Automation tab
  5. Find CI Auto-Fix
  6. Set the mode to Enable
  7. Set Maximum fix attempts per PR
  8. Click Save

What It Usually Fixes Well

  • Linting errors
  • Type errors
  • Straightforward test failures
  • Build errors such as missing imports or syntax issues

What Usually Needs Manual Intervention

  • Complex failures that require product or business logic decisions
  • Architecture-level problems
  • Multi-file refactors without a clear local fix
  • Infrastructure issues outside the repository
  • External service failures

Result Comments

Starting

🔧 CI Auto-Fix started

Detected failure in GitHub Actions workflow "Test".
Analyzing logs and generating fix...

Attempt 1/3

Success

✅ CI Auto-Fix completed

Fixed issue in src/utils/validation.ts:
- Updated email regex to reject consecutive dots
- Added test case for invalid email format

Commit: abc1234

Maximum Attempts

When CI auto-fix reaches the maximum number of consecutive attempts for a PR without success, it stops automatically. This prevents infinite retry loops when issues cannot be fixed automatically.

When this happens, Forkline posts a comment indicating that CI auto-fix is paused:

⏸️ CI Auto-Fix paused

Maximum consecutive fix attempts (3/3) reached for this PR without success.
CI auto-fix is now paused to prevent infinite retry loops.

You can:
- Review the CI logs and fix the issue manually
- Use `/reset` or `/reset-ci-auto-fix` to give CI auto-fix another chance after making changes

To configure the maximum attempts, go to **Repository Settings** > **Automation** > **CI Auto-Fix**.

You can configure the maximum attempts in repository settings under Automation > CI Auto-Fix > Maximum fix attempts per PR.

Pausing and Resuming

Automatic Pause

CI auto-fix automatically pauses when you push a commit to the PR branch after Forkline has pushed a fix. This prevents conflicts between your changes and automated fixes.

When this happens, Forkline posts a comment indicating that CI auto-fix is paused:

⏸️ CI Auto-Fix paused

A user commit was detected after an automated fix. CI auto-fix is now paused
to prevent conflicts with your changes.

To resume CI auto-fix, use the `/reset` or `/reset-ci-auto-fix` command.

Resuming with /reset

To resume CI auto-fix after it has been paused (either due to user commits or reaching maximum attempts), use the /reset command:

@forkline /reset

You can also use the longer form /reset-ci-auto-fix:

@forkline /reset-ci-auto-fix

Both commands do the same thing:

  1. Resets the attempt counter - Clears the consecutive failure count back to zero
  2. Unpauses the automation - Allows CI auto-fix to process new failures

Note: After running /reset-ci-auto-fix, the bot immediately re-evaluates the current CI status for the PR. If CI is still failing, a new fix attempt starts right away — you don’t need to wait for a new push or CI run. If CI is passing, no action is taken.

When to Use

Use /reset when:

  • You’ve resolved the conflict that caused the pause and want CI auto-fix to continue monitoring
  • CI auto-fix hit the maximum attempt limit, but you believe the issue can now be fixed (e.g., after you made manual changes)
  • You want to give CI auto-fix another chance after manually addressing part of the problem

Next Steps