Actions REST API: listWorkflowRuns returns stale results (sometimes weeks old) on high-volume repos #206725
Replies: 10 comments 3 replies
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
|
Hi, The behavior you described does look more like an API-side consistency issue than a problem with the One thing I’d try as a diagnostic is to constrain the request with For production tooling, I’d also avoid assuming that the first item from a single broad query is always the definitive latest successful run. If an older run would be dangerous as a comparison base, validating the returned run before using it and retrying when the result is inconsistent would be a safer approach. Given that you have a reproducible example with full request/response logging and a large discrepancy in |
|
We've started encountering this problem as well starting yesterday and twice today. We've relied on this API returning accurate results for years without issue (preventing costly rebuilds and only rebuilding what changed since the previous successful job run). Yesterday (around 2026-09-01T23:59Z) instead of returning a |
This comment was marked as low quality.
This comment was marked as low quality.
|
We are experiencing the same issues since a few days: but every now and then it we get Note how the "latest" run is suddenly over a month ago instead of a few hours. We've notified GitHub Support. |
|
This seems to be related to stale/inconsistent results from the The same request can return different results, sometimes showing workflow runs from weeks ago, and even the Using github.rest.actions.listWorkflowRuns({
owner,
repo,
workflow_id,
head_sha: commitSha,
});However, querying every commit individually is not practical when trying to find the latest workflow run. Is there a recommended way to reliably get the latest workflow run without using |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as low quality.
This comment was marked as low quality.
This comment was marked as off-topic.
This comment was marked as off-topic.
|
Hi, I am experiencing the same issue via the use of https://github.com/dawidd6/action-download-artifact which clearly assumes the returned workflows are returned the most recent runs first. The parameters of the action are:
Which leads to As one stated above, it seems to happen more frequently when queried from GitHub actions. When the API is invoked with |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Bug
💬 Feature/Topic Area
API
Body
Describe the bug
GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs(and the repo-wideGET /repos/{owner}/{repo}/actions/runsvariant) intermittently returns a stale result set on arepository with a high volume of workflow runs. The same exact query, called seconds to minutes
apart with no other change, returns a materially different "most recent" run and a different
total_count, with the stale response sometimes landing weeks behind the true most recent run.This reproduces both with and without the
statusfilter, so it isn't specific to that parameter.Steps to reproduce
many pushes a day, call:
GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs?branch={branch}&event=push&status=success&per_page=1total_countandworkflow_runs[0].head_sha/created_atbetween the two responses.Note: this seems to happen a LOT more frequently when run in GitHub actions, e.g. via
github-scriptinvoking:Actual behavior
Observed both of the following independently:
total_count: 1942with thetop run dated ~3 weeks old, then
total_count: 4265with the top run dated seconds ago. No newworkflow runs could plausibly account for that count jump in that time window.
actions/github-script/@octokit/plugin-paginate-rest, with full HTTP debug logging enabled) and picked a specific commitas "the most recent successful run" that was in fact ~3.5 weeks and several hundred commits behind
the actual most recent successful run on that branch at that exact moment. Re-running the identical
query moments later, and a time-bounded reconstruction using the
createdfilter to pin the exactsame instant, both showed the true most recent successful run should have been returned instead.
This occurred both with
status=successset and with it omitted (filtering client-side onconclusioninstead), so dropping that particular filter is not a workaround.Expected behavior
The endpoint should reflect the actual current state of workflow runs.
The endpoint should NOT return data that is stale by several weeks.
Impact
This endpoint is a documented, commonly recommended way to find "the last successful run on a branch"
for CI/CD tooling. On a busy repo, staleness of this magnitude causes CI to silently use a wildly
outdated comparison base, with no error surfaced, since the query itself returns a normal-looking
(but stale) 200 response.
Additional context
All reactions