Add Actions logs commands using existing Gitea 1.25 API #1

Closed
opened 2025-12-30 18:18:11 +00:00 by HugoNijhuis · 0 comments
Owner

Summary

Implement tea actions commands to view workflow runs and logs using the existing Gitea 1.25 API endpoints. This is a simpler alternative to waiting for upstream PRs (tea#838, go-sdk#735, gitea#35382) which are blocked on each other.

Available API Endpoints (Gitea 1.25.3)

These endpoints already exist and can be used:

  • GET /repos/{owner}/{repo}/actions/runs - list all runs
  • GET /repos/{owner}/{repo}/actions/runs/{run} - get specific run
  • GET /repos/{owner}/{repo}/actions/runs/{run}/jobs - list jobs for a run
  • GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs - download job logs
  • DELETE /repos/{owner}/{repo}/actions/runs/{run} - delete a run

Commands to Implement

tea actions runs

List workflow runs for a repository.

tea actions runs --repo owner/repo
tea actions runs --repo owner/repo --limit 10

tea actions jobs <run-id>

List jobs for a specific run.

tea actions jobs 123 --repo owner/repo

tea actions logs <job-id>

Display logs for a specific job.

tea actions logs 456 --repo owner/repo

Implementation Plan

1. Explore existing codebase

  • Study cmd/repos/ for subcommand group patterns
  • Study cmd/issues/list.go for list command patterns
  • Study modules/task/ for API client usage

2. Create command structure

cmd/actions/
├── actions.go      # main "tea actions" command group
├── runs.go         # "tea actions runs" - list runs
├── jobs.go         # "tea actions jobs <run-id>" - list jobs
└── logs.go         # "tea actions logs <job-id>" - show logs

3. Implement API calls

The go-sdk may not have Actions methods yet, so you may need to:

  • Add direct HTTP calls using tea's existing client
  • Or add methods to a local fork of go-sdk

4. Test locally

go build
./tea actions runs --repo flowmade-one/somerepo
./tea actions jobs 123 --repo flowmade-one/somerepo  
./tea actions logs 456 --repo flowmade-one/somerepo

References

## Summary Implement `tea actions` commands to view workflow runs and logs using the existing Gitea 1.25 API endpoints. This is a simpler alternative to waiting for upstream PRs ([tea#838](https://gitea.com/gitea/tea/pulls/838), [go-sdk#735](https://gitea.com/gitea/go-sdk/pulls/735), [gitea#35382](https://github.com/go-gitea/gitea/pull/35382)) which are blocked on each other. ## Available API Endpoints (Gitea 1.25.3) These endpoints already exist and can be used: - `GET /repos/{owner}/{repo}/actions/runs` - list all runs - `GET /repos/{owner}/{repo}/actions/runs/{run}` - get specific run - `GET /repos/{owner}/{repo}/actions/runs/{run}/jobs` - list jobs for a run - `GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs` - download job logs - `DELETE /repos/{owner}/{repo}/actions/runs/{run}` - delete a run ## Commands to Implement ### `tea actions runs` List workflow runs for a repository. ```bash tea actions runs --repo owner/repo tea actions runs --repo owner/repo --limit 10 ``` ### `tea actions jobs <run-id>` List jobs for a specific run. ```bash tea actions jobs 123 --repo owner/repo ``` ### `tea actions logs <job-id>` Display logs for a specific job. ```bash tea actions logs 456 --repo owner/repo ``` ## Implementation Plan ### 1. Explore existing codebase - Study `cmd/repos/` for subcommand group patterns - Study `cmd/issues/list.go` for list command patterns - Study `modules/task/` for API client usage ### 2. Create command structure ``` cmd/actions/ ├── actions.go # main "tea actions" command group ├── runs.go # "tea actions runs" - list runs ├── jobs.go # "tea actions jobs <run-id>" - list jobs └── logs.go # "tea actions logs <job-id>" - show logs ``` ### 3. Implement API calls The go-sdk may not have Actions methods yet, so you may need to: - Add direct HTTP calls using tea's existing client - Or add methods to a local fork of go-sdk ### 4. Test locally ```bash go build ./tea actions runs --repo flowmade-one/somerepo ./tea actions jobs 123 --repo flowmade-one/somerepo ./tea actions logs 456 --repo flowmade-one/somerepo ``` ## References - [Gitea API 1.25 docs](https://docs.gitea.com/api/1.25/) - [Upstream tea PR #838](https://gitea.com/gitea/tea/pulls/838) - [Upstream go-sdk PR #735](https://gitea.com/gitea/go-sdk/pulls/735) - [Upstream gitea PR #35382](https://github.com/go-gitea/gitea/pull/35382)
HugoNijhuis added a new dependency 2026-01-06 12:47:38 +00:00
HugoNijhuis removed a dependency 2026-01-06 12:47:55 +00:00
HugoNijhuis added a new dependency 2026-01-06 12:48:12 +00:00
HugoNijhuis removed a dependency 2026-01-06 12:48:21 +00:00
HugoNijhuis added a new dependency 2026-01-06 12:54:24 +00:00
HugoNijhuis removed a dependency 2026-01-06 12:54:45 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: flowmade-one/tea#1