diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 139a9a57..b129af05 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,3 +26,26 @@ jobs: - name: Test run: npm test + + - name: Comment to PR + if: failure() && github.event_name == 'pull_request' + uses: thollander/actions-comment-pull-request@v2 + with: + message: "⚠️ The tests have failed, @${{ github.actor }} Please review the proposed changes." + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Send message to Discord + env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + if: failure() && github.event_name == 'pull_request' + uses: Ilshidur/action-discord@master + with: + args: | + ⚠️ The GitHub event `${{ github.event_name }}` has failed. + **Repository**: `${{ github.repository }}` + **Workflow**: `${{ github.workflow }}` + **Actor**: `${{ github.actor }}` + **Pull Request**: [Link](${{ github.event.pull_request.html_url }}) + **Action URL**: [View Details](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) + Please review the proposed changes. +