I’ve set up GitHub Actions in a repo and created a workflow for CI. In this workflow, I have some 5 jobs which are triggered like this:
job 1: immediately
jobs 2, 3, 4: as job 1 successfuly finishes ( needs: [job1] )
job 5: as jobs 2, 3, 4 successfuly finish ( needs: [job2, job3, job4] )
I noticed that when job1 executes successfuly, thus triggering execution of the jobs that depend on it, a check_suite.completed(status = “success”) event is emitted. Looking at the UI showing the workflow run, this happens well before the workflow completed executing all of its defined jobs.
Now, according to the docs:
GitHub Actions use the Checks API to output statuses, results, and logs for a workflow. GitHub creates a new check suite for each workflow triggered by the same event. The check suite contains a check run for each job in the workflow, and each job includes steps. GitHub Actions are run as a step in a workflow.
By this mapping of workflows to the checks API, the check_suite.completed event shoud trigger only after all the workflow jobs have ran. This would make sense.
In my use case, a webhook is listening to the check_suite.completed event to decide on approving a PR. Given that these events fire prematurely, it can very well be that approvals will be issued on an ultimately failing check_suites.
Worth noting, removing sequencing (the needs: [job*] statements), making all jobs run in parallel resolves this issue, with the check_suite.completed event triggering at the end of the workflow (according to the UI)
Has anyone else run into this issue? This looks like a bug to me.