File tree Expand file tree Collapse file tree 1 file changed +53
-0
lines changed
Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Discord Issues & Comments
2+
3+ on :
4+ issues :
5+ types : [opened]
6+ issue_comment :
7+ types : [created]
8+
9+ jobs :
10+ notify :
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ - name : Send issue or comment to Discord
15+ env :
16+ DISCORD_WEBHOOK : ${{ secrets.DISCORD_WEBHOOK }}
17+ run : |
18+ if [[ "${{ github.event_name }}" == "issues" ]]; then
19+ curl -X POST "$DISCORD_WEBHOOK" \
20+ -H "Content-Type: application/json" \
21+ -d '{
22+ "thread_name": "Issue #'${{ github.event.issue.number }}' – '${{ github.event.issue.title }}'",
23+ "embeds": [
24+ {
25+ "title": "🐛 New Issue Opened",
26+ "description": "**'${{ github.event.issue.title }}'**",
27+ "url": "${{ github.event.issue.html_url }}",
28+ "color": 15158332,
29+ "fields": [
30+ {
31+ "name": "Author",
32+ "value": "'${{ github.event.issue.user.login }}'",
33+ "inline": true
34+ },
35+ {
36+ "name": "Repository",
37+ "value": "'${{ github.repository }}'",
38+ "inline": true
39+ }
40+ ],
41+ "footer": {
42+ "text": "GitHub Issues"
43+ }
44+ }
45+ ]
46+ }'
47+ else
48+ curl -X POST "$DISCORD_WEBHOOK" \
49+ -H "Content-Type: application/json" \
50+ -d '{
51+ "content": "💬 **New comment on Issue #'${{ github.event.issue.number }}'**\n**'${{ github.event.comment.user.login }}'**:\n${{ github.event.comment.body }}\n🔗 ${{ github.event.comment.html_url }}"
52+ }'
53+ fi
You can’t perform that action at this time.
0 commit comments