Skip to content

Commit 0bcfbd4

Browse files
committed
Different approach to escaping
1 parent 7e237df commit 0bcfbd4

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

.github/workflows/discord-pr-notify.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,15 @@ jobs:
1212
steps:
1313
- name: Send Discord Notification
1414
run: |
15-
curl -X POST ${{ secrets.DISCORD_WEBHOOK }} \
15+
PAYLOAD=$(jq -n \
16+
--arg title "${{ github.event.pull_request.title }}" \
17+
--arg url "${{ github.event.pull_request.html_url }}" \
18+
--arg author "${{ github.event.pull_request.user.login }}" \
19+
'{
20+
content: ("🚀 **New PR:** " + $title + "\n🔗 <" + $url + ">\n👤 **Author:** " + $author),
21+
thread_name: ($title + " by " + $author)
22+
}')
23+
24+
curl -X POST "${{ secrets.DISCORD_WEBHOOK }}" \
1625
-H "Content-Type: application/json" \
17-
-d '{
18-
"content": "🚀 **New PR:** ${{ github.event.pull_request.title }}\n🔗 <${{ github.event.pull_request.html_url }}>\n👤 **Author:** ${{ github.event.pull_request.user.login }}",
19-
"thread_name": "${{ github.event.pull_request.title }} by ${{ github.event.pull_request.user.login }}"
20-
}'
26+
-d "$PAYLOAD"

0 commit comments

Comments
 (0)