Commit graph

1 commit

Author SHA1 Message Date
Tom Foster
be9bd61491 feat(api): add Actions job details and logs API endpoints
Add API endpoints for Forgejo Actions job information and log retrieval,
addressing the limitation where job data was only available through the
web UI with session authentication.

New endpoints:
- GET /api/v1/repos/{owner}/{repo}/actions/runs/{run}/jobs/{job}
  Returns job information including status, timestamps, and steps
- GET /api/v1/repos/{owner}/{repo}/actions/runs/{run}/jobs/{job}/logs
  Returns job logs with support for partial retrieval

Log retrieval query parameters:
- head=N: Return first N lines of the log
- tail=N: Return last N lines of the log
- offset=M: Skip M lines (with head) or skip to M lines from end (with tail)
- format=json: Return structured JSON with line numbers and timestamps

Implementation includes API response types (ActionJobResponse, ActionJobStep,
ActionRunSummary), efficient line-based operations for partial log reading,
integration tests, and Swagger documentation.

The endpoints use standard API token authentication and follow Forgejo's
existing API patterns. Job indices are 0-based matching the web UI behaviour.
2025-08-14 10:46:17 +01:00