@@ -16,31 +16,26 @@ jobs:
1616 COMMIT_COUNT=$(echo '${{ toJson(github.event.commits) }}' | jq length)
1717 COMMITS=$(echo '${{ toJson(github.event.commits) }}' | jq -r '.[] | "- [\(.id[0:7])](\(.url)) - \(.message | gsub("\n"; " "))"' | sed ':a;N;$!ba;s/\n/\\n/g')
1818
19- JSON_PAYLOAD=$(cat <<EOF
20- {
21- "content": "<@&1391832379932545145>",
22- "username": "NSC Commit Bot",
23- "avatar_url": "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png",
24- "embeds": [{
25- "author": {
26- "name": "${{ github.actor }}",
27- "url": "https://github.com/${{ github.actor }}",
28- "icon_url": "https://github.com/${{ github.actor }}.png"
19+ curl -H "Content-Type: application/json" \
20+ -X POST \
21+ -d "{
22+ \"content\": \"<@&1391832379932545145>\",
23+ \"username\": \"NSC Commit Bot\",
24+ \"avatar_url\": \"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\",
25+ \"embeds\": [{
26+ \"author\": {
27+ \"name\": \"${{ github.actor }}\",
28+ \"url\": \"https://github.com/${{ github.actor }}\",
29+ \"icon_url\": \"https://github.com/${{ github.actor }}.png\"
2930 },
30- "title": "• [${{ github.repository }}] ✨ • ${COMMIT_COUNT} New Commit${COMMIT_COUNT > 1 && "s" || ""}! ",
31- "description": "${COMMITS}",
32- "url": "https://github.com/${{ github.repository }}",
33- "color": 3447003,
34- "footer": {
35- "text": "Pushed to branch: main"
31+ \ "title\ ": \ "• [${{ github.repository }}] ✨ • ${COMMIT_COUNT} New Commits!\ ",
32+ \ "description\ ": \ "${COMMITS}\ ",
33+ \ "url\ ": \ "https://github.com/${{ github.repository }}\ ",
34+ \ "color\ ": 3447003,
35+ \ "footer\ ": {
36+ \ "text\ ": \ "Pushed to branch: main\ "
3637 },
37- "timestamp": "${{ github.event.head_commit.timestamp }}"
38+ \ "timestamp\ ": \ "${{ github.event.head_commit.timestamp }}\ "
3839 }]
39- }
40- EOF
41- )
42-
43- curl -H "Content-Type : application/json" \
44- -X POST \
45- -d "$JSON_PAYLOAD" \
46- $DISCORD_WEBHOOK
40+ }" \
41+ $DISCORD_WEBHOOK
0 commit comments