You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit adds full API support for GitHub Actions-compatible
workflow run management, providing CLI equivalent functionality
to GitHub's 'gh run' command for Gitea instances.
New API endpoints:
- POST /api/v1/repos/{owner}/{repo}/actions/runs/{run_number}/rerun
- POST /api/v1/repos/{owner}/{repo}/actions/runs/{run_number}/cancel
- POST /api/v1/repos/{owner}/{repo}/actions/runs/{run_number}/approve
- POST /api/v1/repos/{owner}/{repo}/actions/runs/{run_number}/jobs/{job_id}/rerun
- POST /api/v1/repos/{owner}/{repo}/actions/runs/{run_number}/logs (streaming)
Features:
- Intelligent dependency-aware job rerunning using existing GetAllRerunJobs()
- Real-time log streaming with cursor-based pagination
- Comprehensive permission checking (repository write access required)
- Full compatibility with existing web UI business logic
- Support for 'latest' keyword for most recent workflow run
- Streaming logs endpoint for real-time monitoring
Implementation highlights:
- Leverages existing web controller logic for maximum reliability
- Ultra-lean approach: 822 lines of new code with comprehensive functionality
- Full integration test coverage (180 lines)
- Swagger/OpenAPI documentation included
- Follows Gitea's existing API patterns and error handling
- Uses Gitea's modules/json for depguard compliance
This enables full CLI workflow management for Gitea Actions,
matching GitHub's runner management capabilities while
maintaining consistency with Gitea's architecture and patterns.
Fixes: Enables equivalent functionality to GitHub CLI 'gh run' commands
Test coverage: Comprehensive integration tests included
0 commit comments