Add GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs#37196
Add GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs#37196bn-zr wants to merge 16 commits intogo-gitea:mainfrom
Conversation
bn-zr
commented
Apr 13, 2026
- Add GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs endpoint, matching the https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2026-03-10#list-workflow-runs-for-a-workflow
|
This PR aims for GitHub API compatibility. A few items drift from that — implement what's feasible.
Comment written by Claude Opus 4.6. |
- Update workflow_id swagger description to clarify filename-only - Add exclude_pull_requests query parameter - Return 404 for nonexistent workflow in ActionsListWorkflowRuns - Remove break from test loop so all runs are verified - Add actor and head_sha filter coverage to testAPIWorkflowRunsByWorkflowID - Update nonexistent workflow test to expect 404
c1fd337 to
e15b1c2
Compare
|
passes locally @silverwind can you rerun? thats weird... |
|
Ensure you run without test cache: |
|
Is it ready? |
Fix false 404s from ActionsListWorkflowRuns: the previous check returned 404 whenever no runs existed, so a valid workflow that hadn't been triggered yet was reported as missing. Accept either existing runs or a workflow file on the default branch as proof of existence; run lookup runs first since it's cheaper than parsing workflow YAML on every call. Also use the HookEventPullRequest constant instead of a raw string literal for the trigger_event filter, switch the new exclude_pull_requests query param to ctx.FormBool, and add a test asserting exclude_pull_requests filters out pull_request-event runs. Co-Authored-By: Claude (Opus 4.7) <[email protected]>
|
Cleaned up and addressed outstanding review in 897e97e. |
| } | ||
| if opts.ExcludePullRequests { | ||
| cond = cond.And(builder.Neq{"`action_run`.trigger_event": string(webhook_module.HookEventPullRequest)}) | ||
| } |
There was a problem hiding this comment.
You're right, original review was a hallucination. Fixing it.
There was a problem hiding this comment.
I don't want to be right.
I really hope maintainers can be more careful for the AI outputs, don't blindly trust them.
There was a problem hiding this comment.
Review was from lobotomized Opus 4.6, sorry. And yes we need to be more careful.
There was a problem hiding this comment.
Adding this seems to considerably increase this PR's scope, not sure it's worth. I'll push it, then we can decide whether to keep it or omit that flag for now.
There was a problem hiding this comment.
Missed the right meaning of ExcludePullRequests
The previous implementation interpreted exclude_pull_requests=true as
"filter out runs whose trigger event is pull_request", but GitHub's
parameter empties the pull_requests field on each run object instead —
the runs themselves are always returned.
Add a pull_requests field to ActionWorkflowRun matching GitHub's
minimal schema (id, number, url, head{ref,sha,repo{id,url,name}},
base{…}). Populate it in ToActionWorkflowRun from the PR that triggered
the run (pull_request / pull_request_review events) or from open PRs
whose head branch matches the push ref (push events). When the list
endpoint receives exclude_pull_requests=true, the flag short-circuits
the PR lookup so the field stays empty.
The removal of ExcludePullRequests from FindRunOptions undoes the wrong
trigger_event filter.
Co-Authored-By: Claude (Opus 4.7) <[email protected]>
615047f to
1e0262f
Compare
