# GitHubWriteAdapter

**Kind:** Class

**Source:** [`atloria-monorepo/apps/api/src/docs-pr/git-write/github-write.adapter.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/apps/api/src/docs-pr/git-write/github-write.adapter.ts#L22)

Opens (or updates) a docs-fix PR on GitHub via the existing GitHub App installation
token. Hand-rolled REST over axios to match the house style (no octokit in the repo).

Strategy: the head branch always carries exactly ONE commit off the base tip, so the
PR diff is clean and a follow-up push simply force-updates that single commit —
GitHub then updates the same PR (dedupe by head branch). Nothing merges automatically.

**Extends:** `GitWriteAdapter`

## Methods

| Method | Signature | Returns |
|---|---|---|
| `openOrUpdatePr` | `openOrUpdatePr(input: OpenOrUpdatePrInput)` | `Promise<OpenOrUpdatePrResult>` |

## Where it refuses work

- `GitHubWriteAdapter` stops the work with `Error` when `baseRef.status !== 200`.
- `GitHubWriteAdapter` stops the work with `WriteNotPermittedError` when `!creds?.password`.
- `GitHubWriteAdapter` stops the work with `WriteNotPermittedError` when `res.status === 403`.
- `GitHubWriteAdapter` stops the work with an early return when `input.token`.
