Skip to content

fix(actions): resolve workflow runs by run_number in API#38288

Open
afahey03 wants to merge 1 commit into
go-gitea:mainfrom
afahey03:fix/actions-api-resolve-run-by-number
Open

fix(actions): resolve workflow runs by run_number in API#38288
afahey03 wants to merge 1 commit into
go-gitea:mainfrom
afahey03:fix/actions-api-resolve-run-by-number

Conversation

@afahey03

@afahey03 afahey03 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Run-scoped Actions API handlers only resolved {run} by database ID, while the web UI also accepts the repo-scoped run_number (index). Callers who used run_number from /actions/tasks or the UI URL could get an empty job list from GET /api/v1/repos/{owner}/{repo}/actions/runs/{run}/jobs even when jobs were visible in the browser. This PR adds the same ID-then-index fallback to getCurrentRepoActionRunByID, which is shared by run-scoped API endpoints including job listing.

Test

ListRunJobsByRunNumber loads fixture run 795, which has id 795 and run_number 191, and calls GET /api/v1/repos/user2/repo2/actions/runs/191/jobs. It asserts the response is HTTP 200 with a non-zero total_count and that job 198 is present in the list.

Closes #38286

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jul 1, 2026
@Zettat123

Copy link
Copy Markdown
Contributor

I don't think it's necessary to add this fallback. Callers can get run_id and job_id from other APIs. Even if this fallback is added, if both run_id and run_index are valid, the caller still won't be able to fetch the jobs list via run_index.

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. type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/actions/runs/{N}/jobs returns empty .jobs[] for completed runs

3 participants