diff --git a/.github/workflows/discord-pr-notify.yml b/.github/workflows/discord-pr-notify.yml index 65e931cf22..88c918edfe 100644 --- a/.github/workflows/discord-pr-notify.yml +++ b/.github/workflows/discord-pr-notify.yml @@ -12,9 +12,15 @@ jobs: steps: - name: Send Discord Notification run: | - curl -X POST ${{ secrets.DISCORD_WEBHOOK }} \ + PAYLOAD=$(jq -n \ + --arg title "${{ github.event.pull_request.title }}" \ + --arg url "${{ github.event.pull_request.html_url }}" \ + --arg author "${{ github.event.pull_request.user.login }}" \ + '{ + content: ("šŸš€ **New PR:** " + $title + "\nšŸ”— <" + $url + ">\nšŸ‘¤ **Author:** " + $author), + thread_name: ($title + " by " + $author) + }') + + curl -X POST "${{ secrets.DISCORD_WEBHOOK }}" \ -H "Content-Type: application/json" \ - -d '{ - "content": "šŸš€ **New PR:** ${{ github.event.pull_request.title }}\nšŸ”— <${{ github.event.pull_request.html_url }}>\nšŸ‘¤ **Author:** ${{ github.event.pull_request.user.login }}", - "thread_name": "${{ github.event.pull_request.title }} by ${{ github.event.pull_request.user.login }}" - }' + -d "$PAYLOAD"