Skip to content

Conversation

rossigee
Copy link

Implements comprehensive REST API endpoints for GitHub Actions workflow runs:

  • POST /actions/runs/{run}/rerun - Rerun entire workflow run
  • POST /actions/runs/{run}/cancel - Cancel running workflow
  • POST /actions/runs/{run}/approve - Approve workflow requiring approval
  • POST /actions/runs/{run}/jobs/{job_id}/rerun - Rerun specific job
  • GET /actions/runs/{run}/logs - Download run logs archive
  • GET /actions/runs/{run}/jobs/{job_id}/logs - Download job logs
  • POST /actions/runs/{run}/logs - Stream logs with cursor support

Features:

  • Proper permission checks and workflow validation
  • Support for "latest" run parameter
  • Job dependency handling for reruns
  • Streaming log API with cursor-based pagination
  • Comprehensive test coverage

Fixes workflow management gaps in API compatibility.

Implements comprehensive REST API endpoints for GitHub Actions workflow runs:

- POST /actions/runs/{run}/rerun - Rerun entire workflow run
- POST /actions/runs/{run}/cancel - Cancel running workflow
- POST /actions/runs/{run}/approve - Approve workflow requiring approval
- POST /actions/runs/{run}/jobs/{job_id}/rerun - Rerun specific job
- GET /actions/runs/{run}/logs - Download run logs archive
- GET /actions/runs/{run}/jobs/{job_id}/logs - Download job logs
- POST /actions/runs/{run}/logs - Stream logs with cursor support

Features:
- Proper permission checks and workflow validation
- Support for "latest" run parameter
- Job dependency handling for reruns
- Streaming log API with cursor-based pagination
- Comprehensive test coverage

Fixes workflow management gaps in API compatibility.
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 29, 2025
@github-actions github-actions bot added modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code labels Aug 29, 2025
@rossigee
Copy link
Author

Addresses #35176

@ChristopherHX
Copy link
Contributor

Please be aware existing Gitea workflow api do not use runindex, {run} is expected to be the run id.

also jobs use jobid instead of jobindex.


GET /actions/runs/{run}/jobs/{job_id}/logs - Download job logs
is already implemented

m.Get("/{job_id}/logs", repo.DownloadActionsRunJobLogs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants