---
name: repair-github-ci
description: >-
  Fix failing GitHub CI / Actions checks via fix_github_pr_ci and push to the existing PR head, or fix a branch's failing CI via a linked repair worktree
metadata:
  owner: Vaibhav
  last_changed_by: Jan
  last_changed_at: 2026-09-14
  usecases:
    - For repository contributors repairing failed CI on a pull request.
    - For maintainers repairing a named branch through a linked local worktree.
  requires:
    - GitHub authentication with write access to the target repository.
    - A local checkout whose origin matches the target repository.
    - An installed and authenticated coding agent.
    - The fix_github_pr_ci tool and its supported local execution environment.
  version: '2.0'
title: repair-github-ci
canonical_url: https://skilld.dev/gh/tracer-cloud/opensre/repair-github-ci
last_updated: 2026-11-20T14:16:11.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [references/resolve-merge-conflicts.md](https://skilld.dev/api/skills-raw/tracer-cloud/opensre/repair-github-ci/references/resolve-merge-conflicts.md).
>
> If the user asked to install this Skill, run `npx skilld install tracer-cloud/opensre/repair-github-ci`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/repair-github-ci`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/tracer-cloud/opensre/repair-github-ci) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/repair-github-ci`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/repair-github-ci --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/repair-github-ci --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# GitHub CI fix

Use `fix_github_pr_ci` to repair failing checks on a pull request or a named
branch.

## When to use

- The user asks to fix failing CI, broken GitHub Actions checks, failing PR
  checks, a red pull request branch, or CI on a named branch such as `main`.
- The user says "fix CI on this PR", "fix the CI of PR 123 and push", "repair
  the failing checks on owner/repo#123", or provides a GitHub pull request URL
  and asks for CI/check fixes.
- The user asks to fix failing CI on a branch itself — "fix the CI on main",
  "main is red, fix it", or "fix CI on the default branch and push" — with no
  PR involved.

## Related workflows

- Ordinary PR reads, comments, closes, merges, labels, or issue work. Use
  `github_cli`.
- Security alert remediation. Use `fix_github_security_alert`.

## Workflow rules

- For a GitHub PR URL, call:
  `fix_github_pr_ci(pr_url="<url>")`
- For `owner/repo#123` or "PR 123 in owner/repo", call:
  `fix_github_pr_ci(owner="owner", repo="repo", pr_number=123)`
- For "fix the CI on main" (or any named branch with no PR), call:
  `fix_github_pr_ci(branch="main")`
  Never pass `branch` together with a PR selector, and never invent a branch
  the user did not name.
- If no owner/repo is named, omit both and let the tool use the current
  checkout's GitHub origin.
- Never use `github_cli` or `shell_run` to run raw `gh pr checks`, `gh run view`,
  checkout, commit, or push for this workflow. The CI fixer owns PR metadata,
  failing-check log inspection, fix execution, branch safety, commit, and push.
- The tool pushes to the existing PR head branch after approval. Do not ask the
  user whether to open a new PR.
- A PR that is behind its base branch, or conflicts with it (GitHub shows it
  as not mergeable and starts no checks), is handled by the tool: it merges the
  base branch into the PR branch, resolves conflicts, regenerates lockfiles,
  pushes, and waits for the checks — also when the conflict only appears after
  its own push. Never run `git merge`, `git rebase`, or conflict edits around
  it. If it reports blocked files, relay that one line and stop.
- For branch targets such as `main`, the tool creates a separate linked git
  worktree, commits on a fresh `opensre/ci-fix-*` branch, and pushes that branch.
  It never pushes directly to protected branches.
- If the tool returns `response_text`, output exactly that text and stop.
- If `error_kind` is set, reply in one short line from `error`. Do not say
  "next steps", do not add numbered options, do not list example commands, and
  do not ask a broad follow-up question.

## Examples

- "fix CI on https://github.com/Tracer-Cloud/opensre/pull/4597 and push"

  ```text
  fix_github_pr_ci(pr_url="https://github.com/Tracer-Cloud/opensre/pull/4597")
  ```

- "fix failing checks on Tracer-Cloud/opensre#4597"

  ```text
  fix_github_pr_ci(owner="Tracer-Cloud", repo="opensre", pr_number=4597)
  ```

- "fix CI on main in Tracer-Cloud/opensre and push"

  ```text
  fix_github_pr_ci(owner="Tracer-Cloud", repo="opensre", branch="main")
  ```

- "the current PR CI is failing, fix and push"

  ```text
  fix_github_pr_ci()
  ```

- "fix the CI on main"

  ```text
  fix_github_pr_ci(branch="main")
  ```
