Skip to content

Commit b495a43

Browse files
authored
Update main.yml
1 parent 3d59f11 commit b495a43

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

.github/workflows/main.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,27 @@ on:
99
create:
1010
delete:
1111
release:
12-
# Add any other events you want to track
12+
workflow_dispatch: # Allows manual trigger
1313

1414
jobs:
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"

0 commit comments

Comments
 (0)