R
Rishtaara
React Native Advanced: CI/CD Pipeline Mastery
Lesson 16 of 19Article12 min

Discord Webhooks (Build Notifications)

Mobile releases involve QA, product, and support — not just developers. Discord webhooks push build results to a channel instantly. Include version, branch, commit, author, and link to CI run for one-click debugging.

Real-time team visibility

Mobile releases involve QA, product, and support — not just developers. Discord webhooks push build results to a channel instantly. Include version, branch, commit, author, and link to CI run for one-click debugging.

Discord notification flow

Setup Discord webhook

  • Discord server → Channel settings → Integrations → Webhooks → New Webhook.
  • Copy webhook URL; add as DISCORD_WEBHOOK in GitHub Secrets.
  • Create #mobile-releases channel for staging; #mobile-alerts for failures.
  • Never expose webhook URL in public repos — rotate if leaked.
GitHub Actions — rich Discord embed
- name: Notify Discord
  if: always()
  env:
    DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
    STATUS: ${{ job.status }}
  run: |
    COLOR=3066993
    [ "$STATUS" = "failure" ] && COLOR=15158332
    curl -H "Content-Type: application/json" -X POST "$DISCORD_WEBHOOK" -d "{
      \"embeds\": [{
        \"title\": \"📱 RN Build: $STATUS\",
        \"description\": \"**Branch:** ${{ github.ref_name }}\n**Commit:** ${{ github.sha }}\n**Author:** ${{ github.actor }}\",
        \"url\": \"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\",
        \"color\": $COLOR,
        \"footer\": { \"text\": \"Rishtaara CI\" }
      }]
    }"