Github Action didn't trigger status event

Hi, I’m building a Probot. I’m wondering “How can I watch a master commit is success or failure in summary”.

I tried  check_suite.completed , but I’ll get more than one event.

Then I found there’s https://developer.github.com/v3/repos/statuses/

But Github Action didn’t seem to update status like attachments.

Am I wrong? Or there’s another event to watch commit status?

https://api.github.com/repos/{owner\_repo}/commits/{commit_sha}/status 

{
  "state": "pending",
  "statuses": [

  ],
...

Hi@rammusxu

There is not an API to get the summary status of a commit directly.

I would encourage you to get check runs of a commit using this API and then combine all check runs conclusion to calculate the summary status.

1 Like

@yanjingzhu  Thank for your advice.

I tried this. But I guess it’s impossible to get a summary.

Since some github action have if condition, it’s queued and skipped. And sometimes success appeared before failure. 

app.on('check_suite.completed', async context => {
let checks = await context.github.checks.listSuitesForRef({
      ...paramsRef
    });

    checks.data.check_suites.forEach(checkSuite => {
      // app.log(checkSuite)
      app.log(checkSuite.status, checkSuite.conclusion)
    })

}

03:45:04.141Z INFO probot: POST http://localhost:3000/ - 200
03:45:04.318Z INFO probot: queued null
03:45:04.318Z INFO probot: queued null
03:45:04.318Z INFO probot: completed failure
03:45:06.395Z INFO probot: POST http://localhost:3000/ - 200
03:45:07.814Z INFO probot: queued null
03:45:07.815Z INFO probot: completed success
03:45:07.815Z INFO probot: completed failure

Hi @rammusxu , 

There was an existing issue in our interal channel “Check suites have “QUEUED” state, but its workflow runs have already concluded” . Engineering team has fixed this issue and the fix is currently in rollout. Please wait for sometime for it to complete.