Skip to content

Commit d3ff14e

Browse files
committed
Fix : Release error fixed
1 parent 28774b0 commit d3ff14e

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Discord Release Notifier
2+
3+
# This action will only trigger when a new release is "published".
4+
# It won't trigger on drafts or pre-releases.
5+
on:
6+
release:
7+
types: [published]
8+
9+
jobs:
10+
notify:
11+
name: Send Discord Notification
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Send Release Info to Discord
15+
env:
16+
# We securely access the webhook URL from the GitHub secret we created.
17+
DISCORD_WEBHOOK_URL_1: ${{ secrets.DISCORD_WEBHOOK_URL_1 }}
18+
run: |
19+
# This command uses `curl` to send a POST request with a JSON payload.
20+
# The JSON creates a nice-looking "embed" in Discord.
21+
curl -X POST "$DISCORD_WEBHOOK_URL_1" \
22+
-H "Content-Type: application/json" \
23+
-d @- << EOF
24+
{
25+
"username": "JsWeb Releases",
26+
"avatar_url": "https://github.com/Jones-peter/jsweb/blob/main/images/jsweb_logo_bg.png?raw=true",
27+
"embeds": [
28+
{
29+
"title": "🚀 New Release: ${{ github.event.release.name }}",
30+
"url": "${{ github.event.release.html_url }}",
31+
"description": "${{ github.event.release.body }}",
32+
"color": 5814783,
33+
"author": {
34+
"name": "${{ github.event.release.author.login }}",
35+
"url": "${{ github.event.release.author.html_url }}",
36+
"icon_url": "${{ github.event.release.author.avatar_url }}"
37+
},
38+
"footer": {
39+
"text": "JsWeb Framework"
40+
}
41+
}
42+
]
43+
}
44+
EOF

images/jsweb_logo_bg.png

249 KB
Loading

0 commit comments

Comments
 (0)