File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed
Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments