fix(gh): confirm a failing workflow with a different query string (#1)

GitHub can answer one exact run-listing query from an old cached result
for weeks. The same query on a new connection returned the same old
failure, so a workflow whose latest runs passed still showed as failing.

The confirmation request now adds page=1. The changed query skips the
cached result and returns current runs. The test models a cache that
serves the plain query only.
This commit is contained in:
2026-10-02 23:16:09 +01:00
committed by GitHub
parent b74396f005
commit 4c2c9d3341
2 changed files with 8 additions and 5 deletions
+3
View File
@@ -360,6 +360,9 @@ func (c *Client) workflowRuns(ctx context.Context, full string, id int64, branch
path := fmt.Sprintf("/repos/%s/actions/workflows/%d/runs", full, id)
get := c.getJSON
if fresh {
// GitHub can keep answering one exact query from an old cached result, for weeks, whatever
// the connection. A different query string skips that entry and reads current runs.
q.Set("page", "1")
get = c.getJSONFresh
}
if err := get(ctx, full, path, q, &out); err != nil {