|
| 1 | +name: Check Build, Release and Deploy Status |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_run: |
| 5 | + workflows: ['Build, Release and Deploy'] # Triggered by this workflow |
| 6 | + types: |
| 7 | + - completed # Trigger when the workflow completes |
| 8 | + |
| 9 | +jobs: |
| 10 | + notify-status: |
| 11 | + name: Notify Discord on Workflow Status |
| 12 | + runs-on: ubuntu-latest |
| 13 | + |
| 14 | + steps: |
| 15 | + # Notify on Success |
| 16 | + - name: Notify Discord on Success |
| 17 | + if: ${{ github.event.workflow_run.conclusion == 'success' }} # Runs only on success |
| 18 | + uses: tsickert/discord-webhook@v6.0.0 |
| 19 | + with: |
| 20 | + webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }} |
| 21 | + embed-title: '🎉 Build, Release, and Deploy Succeeded!' |
| 22 | + embed-description: | |
| 23 | + **Version:** ${{ github.event.workflow_run.head_branch }} |
| 24 | + **Repository:** ${{ github.repository }} |
| 25 | + **Triggered by:** ${{ github.event.workflow_run.actor }} |
| 26 | + embed-color: 65280 # Green |
| 27 | + embed-footer-text: 'The pipeline completed successfully!' |
| 28 | + |
| 29 | + # Notify on Failure |
| 30 | + - name: Notify Discord on Failure |
| 31 | + if: ${{ github.event.workflow_run.conclusion == 'failure' }} # Runs only on failure |
| 32 | + uses: tsickert/discord-webhook@v6.0.0 |
| 33 | + with: |
| 34 | + webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }} |
| 35 | + embed-title: '🚨 Build, Release, and Deploy Failed!' |
| 36 | + embed-description: | |
| 37 | + **Workflow:** Build, Release, and Deploy |
| 38 | + **Repository:** ${{ github.repository }} |
| 39 | + **Branch:** ${{ github.event.workflow_run.head_branch }} |
| 40 | + **Triggered by:** ${{ github.event.workflow_run.actor }} |
| 41 | + embed-color: 15158332 # Red |
| 42 | + embed-footer-text: 'The pipeline encountered errors.' |
0 commit comments