Skip to content

Update notify_discord.yaml #7

Update notify_discord.yaml

Update notify_discord.yaml #7

name: Notify Discord
on:
push:
branches:
- main
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v3
- name: get commit message
id: get_commit
run: |
COMMIT_MESSAGE=$(git log -1 --pretty=%B)
COMMIT_AUTHOR=$(git log -1 --pretty=format:'%an')
echo "::set-output name=commit_message::$COMMIT_MESSAGE"
echo "::set-output name=commit_author::$COMMIT_AUTHOR"
- name: send webhook to discord
run: |
curl -X POST -H "Content-Type: application/json" \
-d "{\"content\": \"${{ steps.get_commit_info.outputs.commit_message }}\", \"sender\": \"${{ steps.get_commit_info.outputs.commit_author }}\"}" \
https://discord.com/api/webhooks/1288116701459775520/Sz7aGU2Wg-OxGG1hFNbbOsPqreo9KTPhlWyN82hkMqrdgJEfn79g7tJ9PGZSnL1S9UB1