File tree Expand file tree Collapse file tree 1 file changed +55
-0
lines changed
Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Discord Commit Notification
2+ on :
3+ push :
4+ branches :
5+ - main
6+ jobs :
7+ notify :
8+ runs-on : ubuntu-latest
9+ steps :
10+ - name : Send Discord notification
11+ env :
12+ DISCORD_WEBHOOK : ${{ secrets.DISCORD_WEBHOOK }}
13+ run : |
14+ curl -H "Content-Type: application/json" \
15+ -X POST \
16+ -d '{
17+ "username": "GitHub",
18+ "avatar_url": "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png",
19+ "embeds": [{
20+ "title": "Changes Deployed",
21+ "url": "https://github.com/${{ github.repository }}/commit/${{ github.sha }}",
22+ "color": 3447003,
23+ "fields": [
24+ {
25+ "name": "Repository",
26+ "value": "[${{ github.repository }}](https://github.com/${{ github.repository }})",
27+ "inline": true
28+ },
29+ {
30+ "name": "Branch",
31+ "value": "`${{ github.ref_name }}`",
32+ "inline": true
33+ },
34+ {
35+ "name": "Author",
36+ "value": "[${{ github.actor }}](https://github.com/${{ github.actor }})",
37+ "inline": true
38+ },
39+ {
40+ "name": "Commit Message",
41+ "value": "${{ github.event.head_commit.message }}"
42+ },
43+ {
44+ "name": "Commit",
45+ "value": "[`${{ github.sha }}`](https://github.com/${{ github.repository }}/commit/${{ github.sha }})"
46+ }
47+ ],
48+ "footer": {
49+ "text": "GitHub Actions",
50+ "icon_url": "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png"
51+ },
52+ "timestamp": "${{ github.event.head_commit.timestamp }}"
53+ }]
54+ }' \
55+ $DISCORD_WEBHOOK
You can’t perform that action at this time.
0 commit comments