diff --git a/.github/workflows/unit-integration-test.yml b/.github/workflows/unit-integration-test.yml index d6c907b96..a840b7eda 100644 --- a/.github/workflows/unit-integration-test.yml +++ b/.github/workflows/unit-integration-test.yml @@ -23,6 +23,7 @@ jobs: run: yarn install - name: Test + id: unit-test run: yarn test - name: Jest Coverage Comment @@ -49,5 +50,19 @@ jobs: name: coverage-results path: | packages/**/coverage/lcov.info + + - name: Post unit test results to slack + if: always() && github.ref == 'refs/heads/main' && (steps.unit-test.outcome == 'failure') + uses: slackapi/slack-github-action@v1.24.0 + with: + payload: | + { + "source": "GitHub", + "repo": "${{ github.repository}}", + "branch": "${{ github.head_ref || github.ref_name }}", + "message": "unit tests failed" + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file