> ## Documentation Index
> Fetch the complete documentation index at: https://opensre.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Fix GitHub PR CI

> Use OpenSRE to inspect failing GitHub Actions checks on a pull request, apply a fix, and push it to the PR branch.

OpenSRE can inspect failing GitHub Actions checks on a pull request, apply a
code fix in your local checkout, commit it, and push it back to the PR's existing
head branch.

<Warning>
  This is mutating. OpenSRE asks before checking out the PR branch, editing files,
  committing, and pushing.
</Warning>

## Set it up

```bash theme={null}
export CODING_WORKSPACE=/path/to/repo  # optional; defaults to cwd
export GITHUB_TOKEN=... # repo write access plus workflow/check read access
```

OpenSRE uses the configured coding-agent backend through `CODING_AGENT=auto` by
default.

## Use it

In the interactive shell:

```text theme={null}
fix CI on https://github.com/Tracer-Cloud/opensre/pull/4597 and push
fix failing checks on Tracer-Cloud/opensre#4597
the current PR CI is failing, fix and push
```

## What happens

1. OpenSRE reads PR metadata and failing GitHub Actions checks.
2. It fetches compact log excerpts for failing Actions jobs.
3. It verifies the local checkout's `origin` matches the PR repository.
4. It refuses fork PRs because it only pushes to branches in the same repository.
5. After approval, it checks out the PR head branch and applies the fix.
6. If files changed, it commits only the fix-run changes and pushes the PR branch.

If no checks are failing, OpenSRE says so and does not push.
