docs: fix stale references across all documentation

README.md: add missing configure_runners.sh, fix check count 22→24
USAGE_GUIDE.md: fix check refs 23-24→21-22, add CAP column to
  manage_runner list example
PLAN.md: fix mirror-sync→push_mirrors-sync endpoint
contracts/gitea-api.md: add 5 missing endpoints (DELETE tokens,
  repo-scoped runner registration, PUT/POST GitHub Pages, GitHub
  commits), remove unused actions/workflows endpoint, fix
  GET /settings/api Used-in to include Phase 2

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
S
2026-03-01 12:55:23 -05:00
parent 6f97f5f08f
commit 045283be50
4 changed files with 88 additions and 31 deletions

View File

@@ -39,6 +39,20 @@ Auth: `Authorization: token ${GITEA_ADMIN_TOKEN}` (or `GITEA_BACKUP_ADMIN_TOKEN`
---
### DELETE /users/{username}/tokens/{token_name}
**Used in**: Phase 1, Phase 2 (idempotent re-run safety)
**Purpose**: Delete a stale API token before regenerating
**Auth**: Basic auth (`-u username:password`)
**Request**: No body
**Response**: 204 No Content
**404**: Token does not exist (safe to ignore)
**Notes**: Gitea returns 409 Conflict if you try to POST a token with a name that already exists. Deleting first makes token generation idempotent.
---
### GET /user
**Used in**: Preflight (validate token), Phase 1 post-check
@@ -250,6 +264,24 @@ Auth: `Authorization: token ${GITEA_ADMIN_TOKEN}` (or `GITEA_BACKUP_ADMIN_TOKEN`
---
### GET /repos/{owner}/{repo}/actions/runners/registration-token
**Used in**: `manage_runner.sh` (repo-scoped runner registration)
**Purpose**: Get registration token scoped to a specific repo (vs admin-level global token)
**Request**: No body
**Response** (200):
```json
{
"token": "string"
}
```
**Notes**: Used when `repos` field in `runners.conf` is set to a specific repo name instead of `all`. Requires write access to the repo.
---
### POST /repos/{owner}/{repo}/push_mirrors
**Used in**: Phase 6
@@ -375,31 +407,9 @@ Auth: `Authorization: token ${GITEA_ADMIN_TOKEN}` (or `GITEA_BACKUP_ADMIN_TOKEN`
---
### GET /repos/{owner}/{repo}/actions/workflows
**Used in**: Phase 5 post-check
**Purpose**: List workflows in repo
**Response** (200):
```json
{
"total_count": 1,
"workflows": [
{
"id": "string",
"name": "string",
"path": ".gitea/workflows/ci.yml",
"state": "active"
}
]
}
```
---
### GET /settings/api
**Used in**: Phase 1 post-check (verify Actions enabled)
**Used in**: Phase 1 post-check, Phase 2 post-check (verify Actions enabled)
**Purpose**: Get instance API settings
**Response** (200): Settings object with `has_actions` field
@@ -517,6 +527,52 @@ Auth: `Authorization: token ${GITHUB_TOKEN}`
**Response** (204): No Content
### PUT /repos/{owner}/{repo}/pages
**Used in**: Phase 8 teardown (restore Pages configuration)
**Purpose**: Update GitHub Pages configuration
**Request**:
```json
{
"cname": "string",
"source": {
"branch": "main",
"path": "/"
}
}
```
**Response** (204): No Content
### POST /repos/{owner}/{repo}/pages
**Used in**: Phase 8 teardown (re-enable Pages if it was deleted)
**Purpose**: Create/enable GitHub Pages configuration
**Request**:
```json
{
"source": {
"branch": "main",
"path": "/"
}
}
```
**Response** (201): Pages configuration object
### GET /repos/{owner}/{repo}/commits
**Used in**: Phase 6 post-check (compare Gitea and GitHub HEAD SHAs after mirror sync)
**Purpose**: Get recent commits (GitHub side)
**Query params**: `?per_page=1`
**Response** (200): Array of commit objects
**Notes**: The Gitea version of this endpoint is documented above. This GitHub-side usage verifies that push mirror sync propagated the latest commit.
---
## Error Responses