Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github Actions - Workflow job not setting status check

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.

github-branch-protection-rules-status-checks

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

github-status-checks-not-passing

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

github-status-checks-passing

like image 574
alexander.vandekleut Avatar asked Oct 24 '25 08:10

alexander.vandekleut


1 Answers

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.

like image 108
alexander.vandekleut Avatar answered Oct 27 '25 03:10

alexander.vandekleut



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!