discord-pr-notify.yml 820 B

1234567891011121314151617181920212223242526
  1. name: Discord PR Notifier
  2. on:
  3. workflow_dispatch:
  4. pull_request_target:
  5. types: [opened]
  6. jobs:
  7. notify:
  8. runs-on: ubuntu-latest
  9. if: github.head_ref != 'changeset-release/main'
  10. steps:
  11. - name: Send Discord Notification
  12. run: |
  13. PAYLOAD=$(jq -n \
  14. --arg title "${{ github.event.pull_request.title }}" \
  15. --arg url "${{ github.event.pull_request.html_url }}" \
  16. --arg author "${{ github.event.pull_request.user.login }}" \
  17. '{
  18. content: ("🚀 **New PR:** " + $title + "\n🔗 <" + $url + ">\n👤 **Author:** " + $author),
  19. thread_name: ($title + " by " + $author)
  20. }')
  21. curl -X POST "${{ secrets.DISCORD_WEBHOOK }}" \
  22. -H "Content-Type: application/json" \
  23. -d "$PAYLOAD"