Skip to content

Commit 97c893a

Browse files
committed
Update Discord notification to use embeds with emoji
1 parent 6c5234a commit 97c893a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

.github/workflows/discord-notify.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ jobs:
99
env:
1010
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL }}
1111
run: |
12+
COMMIT_MSG=$(echo '${{ github.event.head_commit.message }}' | head -1 | sed 's/"/\\"/g')
1213
curl -s -H "Content-Type: application/json" \
13-
-d "{\"content\": \"Push to **React Native SDK** by ${{ github.actor }}: ${{ github.event.head_commit.message }}\"}" \
14+
-d "{\"embeds\":[{\"title\":\"⚛️ Push to React Native SDK\",\"color\":16043919,\"fields\":[{\"name\":\"Branch\",\"value\":\"${{ github.ref_name }}\",\"inline\":true},{\"name\":\"Author\",\"value\":\"${{ github.actor }}\",\"inline\":true},{\"name\":\"Commit\",\"value\":\"${COMMIT_MSG}\",\"inline\":false}],\"timestamp\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\"}]}" \
1415
"$DISCORD_WEBHOOK"

0 commit comments

Comments
 (0)