When running a GitHub Action workflow, each job that runs automatically publishes a check. I can verify this with the checks endpoint of the REST API
curl \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer TOKEN"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/OWNER/REPO/commits/REF/check-runs
This returns an object like
{
"total_count": 3,
"check_runs": [
{
"id": 9950586881,
"name": "deploy",
"status": "completed",
"conclusion": "success",
...
},
{
"id": 9950580659,
"name": "api-test",
"status": "completed",
"conclusion": "success",
...
},
{
"id": 9950580441,
"name": "ui-test",
"status": "completed",
"conclusion": "success",
...
},
]
}
I set these exact status checks ([deploy, ui-test, api-test]) as required passing before merging.

However, those status checks never get updated in the pull request UI (even though they are there in the REST API call...)

However, when I go to GitHub desktop, it shows that those status checks are there (and passing!)

When I set the event that triggers my workflow to
on:
pull_request
then the checks are automatically populated. I was running it with workflow_dispatch before.
I found that the workflow_dispatch event type was not sufficient to actually populate checks on the PR. Instead, I had to use the pull_request event type.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With