File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 3636 with :
3737 body_path : release_notes.txt
3838 tag_name : ${{ github.ref_name }}
39+
40+ - name : Broadcast release on Discord
41+ env :
42+ DISCORD_WEBHOOK : ${{ secrets.DISCORD_RELEASE_WEBHOOK_URL }}
43+ RELEASE_BODY : ${{ steps.generate_release_notes.outputs.changelog }}
44+ RELEASE_URL : https://github.com/${{ github.repository }}/releases/tag/${{ github.ref_name }}
45+ RELEASE_TAG : ${{ github.ref_name }}
46+ run : |
47+ processed_body=$(echo "$RELEASE_BODY" | perl -0777 -pe 's/\n*### (\S+) (.+?)\n+/\n### `\1` \2\n/g')
48+ final_content=$(printf "%s\n%s" "-# Read the [GitHub release](<${RELEASE_URL}>)." "$processed_body")
49+ jq -n \
50+ --arg content "$final_content" \
51+ --arg username "Tempest ${RELEASE_TAG}" \
52+ '{
53+ content: $content,
54+ username: $username
55+ }' | curl -X POST "$DISCORD_WEBHOOK" \
56+ -H "Content-Type: application/json" \
57+ -d @-
You can’t perform that action at this time.
0 commit comments