Commit 2c933ff
committed
Stop trusting GitHub's Action runs filtering by date
In 1ff8966 (Hot fix: accommodate for (silent?) change in GitHub API's
condition parsing, 2026-01-15), I tried to address a bug that led to
"timeouts" left and right, due to the `created=>${after}` filter not
working as it used to: The corresponding GitHub API call to list all
the recent workflow runs would always return 0 matches. To fix that, I
replaced the `=>` operator with the `>=` operator. With that operator,
the API calls finally returns a non-empty result.
What I failed to anticipate was that the result is completely wrong.
You are forgiven if you think, like I did, that the `created>=${after}`
filter would only return recent runs, as documented here:
https://docs.github.com/en/rest/actions/workflow-runs#list-workflow-runs-for-a-repository
However, this is absolutely, positively not the case. See here:
$ gh api \
repos/gitgitgadget-workflows/gitgitgadget-workflows/actions/runs?actor='gitgitgadget[bot]&event=workflow_dispatch&created>=2030-01-01T00:00:00Z' |r
jq |
grep created_at
"created_at": "2026-01-16T07:32:45Z",
"created_at": "2026-01-16T07:00:21Z",
"created_at": "2026-01-16T05:43:30Z",
"created_at": "2026-01-16T03:02:06Z",
"created_at": "2026-01-16T00:58:29Z",
"created_at": "2026-01-15T23:23:06Z",
"created_at": "2026-01-15T23:17:48Z",
"created_at": "2026-01-15T22:45:12Z",
"created_at": "2026-01-15T22:24:25Z",
"created_at": "2026-01-15T22:21:36Z",
"created_at": "2026-01-15T21:46:03Z",
"created_at": "2026-01-15T21:29:47Z",
"created_at": "2026-01-15T20:59:06Z",
"created_at": "2026-01-15T20:47:15Z",
"created_at": "2026-01-15T20:47:12Z",
"created_at": "2026-01-15T20:47:09Z",
"created_at": "2026-01-15T20:46:01Z",
"created_at": "2026-01-15T20:23:07Z",
"created_at": "2026-01-15T19:54:58Z",
"created_at": "2026-01-15T18:52:06Z",
"created_at": "2026-01-15T18:41:08Z",
"created_at": "2026-01-15T18:37:41Z",
"created_at": "2026-01-15T18:37:38Z",
"created_at": "2026-01-15T18:37:35Z",
"created_at": "2026-01-15T18:37:33Z",
"created_at": "2026-01-15T18:03:28Z",
"created_at": "2026-01-15T17:44:43Z",
"created_at": "2026-01-15T17:37:38Z",
"created_at": "2026-01-15T17:37:30Z",
"created_at": "2026-01-15T17:37:27Z",
As you can see, despite the cut-off that is waaaay in the future, it
totally lists recent runs.
Work around that by distrusting the results returned from that GitHub
API call and manually filtering out the too-old runs.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>1 parent 3b7027b commit 2c933ff
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
0 commit comments