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.
Failure Event
A check run, pipeline, or status signal turns the branch red.
Inspect Logs
Forkline gathers the failing context, logs, and likely reproduction clues.
Generate Fix
The agent changes code or configuration to address the root cause.
Report Back
A follow-up commit or comment explains what changed.
Info: CI auto-fix requires webhook events for CI status such as check runs, pipeline events, or status updates.
Info: On GitLab, CI auto-fix runs only for merge request pipelines. A pipeline that runs for a branch without a merge request is not fixed, so set up your GitLab CI to run pipelines for merge requests. The merge request number is used as the pull request number. CI auto-fix is skipped for merge requests from forks, for merge requests that are no longer open, and for pipelines that run in a project other than the target project.
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
- Navigate to Repositories
- Find your repository
- Click Settings on the repository card
- Select the Automation tab
- Find CI Auto-Fix
- Set the mode to Enable
- Set Maximum fix attempts per PR
- 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. This works on GitHub and Forgejo; on Forgejo, enable the Push trigger on the webhook (it only serves CI auto-fix, so it is optional otherwise).
Info: On GitLab, pushing your own commit after an automated fix does not pause CI auto-fix, because Forkline does not act on push events from GitLab. Pausing after the maximum number of attempts works on all providers.
When this happens on GitHub, Forkline posts a comment indicating that CI auto-fix is paused (on Forgejo the pause is applied without a comment):
⏸️ 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 on GitHub or Forgejo, 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:
- Resets the attempt counter - Clears the consecutive failure count back to zero
- 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.
Note: Like other commands,
/resetand/reset-ci-auto-fixonly work for users the repository’s trigger policy allows.
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