Skip to content

Commit 4bfec52

Browse files
author
Jan Galek
committed
[Add] discord post github workflow
1 parent fbe2160 commit 4bfec52

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Notify Discord on New Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
notify-discord:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Send notification to Discord
13+
env:
14+
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
15+
REPO: ${{ github.repository }}
16+
TAG: ${{ github.ref_name }}
17+
AUTHOR: ${{ github.actor }}
18+
run: |
19+
curl -H "Content-Type: application/json" \
20+
-X POST \
21+
-d '{
22+
"username": "GitHub Actions",
23+
"avatar_url": "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png",
24+
"embeds": [{
25+
"title": "New release of ${REPO}: '${TAG}'",
26+
"url": "https://github.com/'${REPO}'/releases/tag/'${TAG}'",
27+
"description": "${REPO} ${TAG} just released!",
28+
"color": 5814783
29+
}]
30+
}' \
31+
$DISCORD_WEBHOOK_URL

0 commit comments

Comments
 (0)