According to the API docs, I should be able to get the latest check run for a build with a given name CHECK_NAME
using the following URL:
https://api.github.com/repos/${OWNER}/${REPO}/commits/${REF}/check-runs?check_name=${CHECK_NAME}&filter=latest
However, when I run
curl -H "Accept: application/vnd.github.v3+json" 'https://api.github.com/repos/mit-plv/bedrock2/commits/master/check-runs?check_name=build%20(master,%20coq%20libcoq-ocaml-dev,%20ppa:jgross-h/coq-master-daily)&filter=latest'
I get two builds with that given name, instead of just the latest, so it seems that the option filter=latest
was ignored.
Here’s the (shortened) output:
{
"total_count": 2,
"check_runs": [
{
"id": 1684033230,
"node_id": "MDg6Q2hlY2tSdW4xNjg0MDMzMjMw",
"head_sha": "2ac6e6bcb83c206d922636f90fe5edafe3113966",
"external_id": "28581b6d-9d83-512c-1f72-cc25896368d0",
"url": "https://api.github.com/repos/mit-plv/bedrock2/check-runs/1684033230",
"html_url": "https://github.com/mit-plv/bedrock2/runs/1684033230",
"details_url": "https://github.com/mit-plv/bedrock2/runs/1684033230",
"status": "completed",
"conclusion": "success",
"started_at": "2021-01-11T21:02:22Z",
"completed_at": "2021-01-11T22:14:31Z",
"output": {
"title": null,
"summary": null,
"text": null,
"annotations_count": 0,
"annotations_url": "https://api.github.com/repos/mit-plv/bedrock2/check-runs/1684033230/annotations"
},
"name": "build (master, coq libcoq-ocaml-dev, ppa:jgross-h/coq-master-daily)",
"check_suite": {
"id": 1809488584
},
...
},
{
"id": 1683358423,
"node_id": "MDg6Q2hlY2tSdW4xNjgzMzU4NDIz",
"head_sha": "2ac6e6bcb83c206d922636f90fe5edafe3113966",
"external_id": "28581b6d-9d83-512c-1f72-cc25896368d0",
"url": "https://api.github.com/repos/mit-plv/bedrock2/check-runs/1683358423",
"html_url": "https://github.com/mit-plv/bedrock2/runs/1683358423",
"details_url": "https://github.com/mit-plv/bedrock2/runs/1683358423",
"status": "completed",
"conclusion": "failure",
"started_at": "2021-01-11T18:55:26Z",
"completed_at": "2021-01-11T18:56:21Z",
"output": {
"title": "build (master, coq libcoq-ocaml-dev, ppa:jgross-h/coq-master-daily)",
"summary": "There are 1 failures, 0 warnings, and 0 notices.",
"text": null,
"annotations_count": 1,
"annotations_url": "https://api.github.com/repos/mit-plv/bedrock2/check-runs/1683358423/annotations"
},
"name": "build (master, coq libcoq-ocaml-dev, ppa:jgross-h/coq-master-daily)",
"check_suite": {
"id": 1808705523
},
...
}
]
}
I think that this is a bug, because if I specify a check_name
and filter=latest
, I would expect that I get at most one check run, namely the latest one with that name. Or does filter=latest
have a different meaning?