needs.job_id.result
がいずれかのmatrixの結果しか返さない、っぽい。
- GitHub ActionsのMatrix Jobsの結果を受け取るワークアラウンド
- Status check for a matrix jobs · community · Discussion #26822
- Get status of parallel jobs into a single Webhook payload · community · Discussion #26526
いくつかやり方はありそうだったがAPI使ったチェック用ジョブを設定するのが簡単だった。
finish: needs: test if: always() runs-on: ubuntu-latest steps: - name: Check test conclusion env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | gh api /repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs \ | jq -e '.jobs | map(select(.name | test("^test ")).conclusion) | any(. == "failure") | not'