Skip to content

Commit 627b4e6

Browse files
Add GitHub Actions workflow for Discord notifications
1 parent 4ce2354 commit 627b4e6

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Discord Push Notifications
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
notify:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Send commit message to Discord
12+
run: |
13+
COMMIT_MSG="${{ github.event.head_commit.message }}"
14+
COMMIT_URL="${{ github.event.head_commit.url }}"
15+
REPO="${{ github.repository }}"
16+
ACTOR="${{ github.actor }}"
17+
18+
PAYLOAD=$(jq -n \
19+
--arg content "🚀 $ACTOR pushed to **main** in [$REPO]($COMMIT_URL):\n- $COMMIT_MSG" \
20+
'{content: $content}')
21+
22+
curl -H "Content-Type: application/json" \
23+
-d "$PAYLOAD" \
24+
${{ secrets.DISCORD_WEBHOOK }}

0 commit comments

Comments
 (0)