[Bug] GitHub API - List workflow runs returns 0 runs even though there are runs

Trying to use the API or the UI to get workflow runs for a specific branch returns no results.

In the UI, when going to Actions on a repo and filtering by branch shows an error message on top of the page We are having problems searching workflow runs. The results may not be complete.

Using the API and the following endpoint:

curl --location --request GET 'https://api.github.com/repos/{owner}/{repo}/actions/workflows/main.yml/runs?branch=my-branch&per_page=1' \
  -H "Authorization: token <my token>" \
  -H "Content-Type: application/vnd.github.v3+json" \

Returns the following even though I can clearly see the run through the pull request UI, or when in the Actions UI and not filtering by branch.

{
  "total_count": 0,
  "workflow_runs": [

  ]
}
6 Likes

I have the same problem on my side in a private repository.

If you call https://api.github.com/repos/{owner}/{repo}/actions/workflows/main.yml/runs without the branch parameter, you can clearly see the runs from that branch in the list.

Also, it seems to work when filtering on older branch, but not on the new ones.

I tried using curl and the octokit from @actions/github.

2 Likes

Am seeing a similar issue, i need the status=in_progress parameter for one of my workflows. Without the filter I can see several workflows with a status of in_progress. The filter for status=completed works as expected. But status=in_progress always returns:

{
  "total_count": 0,
  "workflow_runs": [

  ]
}
1 Like

I get this as well, but only for branches created the last couple of days.
If I use the branch= filter for one of my older branches, it works.

2 Likes

Same problem although with status= filter. Described it here - List workflow runs API not detecting "in_progress" builds - #5 by gat-bryszard

3 Likes

Seems like it’s resolved now

3 Likes

I have a public repo where this is happening. If I list all workflow runs for a workflow without any query parameters, it returns fine. But if I try to query with a parameter, I always get a 404. Currently using the GH CLI, but also happens in GH Actions.