File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99 create :
1010 delete :
1111 release :
12- # Add any other events you want to track
12+ workflow_dispatch : # Allows manual trigger
1313
1414jobs :
1515 notify :
1616 runs-on : ubuntu-latest
17-
1817 steps :
1918 - name : Send notification to Discord
2019 env :
2120 DISCORD_WEBHOOK : ${{ secrets.DISCORD_WEBHOOK }}
21+ GITHUB_EVENT_NAME : ${{ github.event_name }}
22+ GITHUB_ACTOR : ${{ github.actor }}
23+ GITHUB_REPO : ${{ github.repository }}
24+ GITHUB_ACTION_URL : " https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
2225 run : |
26+ MESSAGE="🔔 **GitHub Event Triggered!**\n
27+ 📢 **Event:** $GITHUB_EVENT_NAME\n
28+ 👤 **Triggered by:** $GITHUB_ACTOR\n
29+ 📂 **Repository:** $GITHUB_REPO\n
30+ 🔗 [View Workflow Run]($GITHUB_ACTION_URL)"
31+
2332 curl -H "Content-Type: application/json" \
2433 -X POST \
25- -d '{ "username": "GitHub Actions", "content": "Something happened in GitHub!"}' \
34+ -d "{\ "username\ ": \ "GitHub Actions\ ", \ "content\ ": \"$MESSAGE\"}" \
2635 "$DISCORD_WEBHOOK"
You can’t perform that action at this time.
0 commit comments