Document undocumented Forgejo CI log retrieval endpoint in forge_ci skill #20

Open
opened 2026-02-18 15:18:12 +00:00 by mik-tf · 0 comments
Member

Problem

The forge_ci skill (Section 3 — Log Retrieval) currently states there is no API endpoint to download CI job logs, and recommends workarounds like reproducing locally or using the browser console.

Discovery

The Forgejo web UI uses an undocumented internal POST endpoint to fetch job step logs. This endpoint works with token authentication and can be used programmatically:

POST /{owner}/{repo}/actions/runs/{run_index}/jobs/{job_index}/attempt/1
Headers:
  Authorization: token $FORGEJO_TOKEN
  Content-Type: application/json
Body:
  {"logCursors":[{"step":N,"cursor":0,"expanded":true}]}

Where:

  • run_index is the human-readable run number (e.g., 620), NOT the internal API ID
  • job_index is 0-based (usually 0 for single-job workflows)
  • step is the 0-based step index within the job
  • Response is JSON containing {"stepsLog": [{"step": N, "logLines": [...]}]}

This was verified on forge.ourworld.tf with the current Forgejo version.

Task

Update Section 3 of claude/skills/forge_ci/SKILL.md to document this endpoint as Option 0 (programmatic, preferred), keeping the existing options as fallbacks.

Also update Section 7 (API Gotchas) item 3 to reflect that logs CAN be retrieved programmatically via this internal endpoint.

## Problem The `forge_ci` skill (Section 3 — Log Retrieval) currently states there is no API endpoint to download CI job logs, and recommends workarounds like reproducing locally or using the browser console. ## Discovery The Forgejo web UI uses an **undocumented internal POST endpoint** to fetch job step logs. This endpoint works with token authentication and can be used programmatically: ``` POST /{owner}/{repo}/actions/runs/{run_index}/jobs/{job_index}/attempt/1 Headers: Authorization: token $FORGEJO_TOKEN Content-Type: application/json Body: {"logCursors":[{"step":N,"cursor":0,"expanded":true}]} ``` Where: - `run_index` is the **human-readable run number** (e.g., 620), NOT the internal API ID - `job_index` is 0-based (usually 0 for single-job workflows) - `step` is the 0-based step index within the job - Response is JSON containing `{"stepsLog": [{"step": N, "logLines": [...]}]}` This was verified on `forge.ourworld.tf` with the current Forgejo version. ## Task Update Section 3 of `claude/skills/forge_ci/SKILL.md` to document this endpoint as **Option 0** (programmatic, preferred), keeping the existing options as fallbacks. Also update Section 7 (API Gotchas) item 3 to reflect that logs CAN be retrieved programmatically via this internal endpoint.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
geomind_code/dev_docs#20
No description provided.