Skip to content

Update main.yml

Update main.yml #7

Workflow file for this run

name: Notify Discord on GitHub Events
on:
push:
pull_request:
issues:
issue_comment:
fork:
create:
delete:
release:
workflow_dispatch: # Allows manual trigger
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Send notification to Discord
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_REPO: ${{ github.repository }}
GITHUB_ACTION_URL: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
run: |
MESSAGE="πŸ”” **GitHub Event Triggered!**\n
πŸ“’ **Event:** $GITHUB_EVENT_NAME\n
πŸ‘€ **Triggered by:** $GITHUB_ACTOR\n
πŸ“‚ **Repository:** $GITHUB_REPO\n
πŸ”— [View Workflow Run]($GITHUB_ACTION_URL)"
curl -H "Content-Type: application/json" \
-X POST \
-d "{\"username\": \"GitHub Actions\", \"content\": \"$MESSAGE\"}" \
"$DISCORD_WEBHOOK"