Github actions: How to check all tests passed?

Hi all! I am writing a workflow for notify the team when a PR has all checks passed and approved, but I don’t know how to get the checks status of a PR. I start with this action:

on:
  pull_request_review:
    types: [submitted]

jobs:
  build:
    if: github.event.review.state == 'approved'
    runs-on: ubuntu-latest
steps: 
    - uses: actions-ecosystem/action-create-comment@v1
      with:
        github_token: ${{ secrets.github_token }}
        body: |
          Hello, @${{ github.actor }}! Thx for approved the PR!

Is these a way to get the pull request’s check status? Thx!

You might try:

n.b. you might be more interested in “mandatory checks” vs “all checks” and for that, I suspect gh doesn’t currently have a thing, but filing a request for it would be reasonable.

You could also look at how it works in case you want to make direct api calls.

(I’m actually half looking into this area for a workflow…)

1 Like