Update notify_discord.yaml #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "commit_message=$COMMIT_MESSAGE" >> $GITHUB_OUTPUT | |
echo "commit_author=$COMMIT_AUTHOR" >> $GITHUB_OUTPUT | |
- name: Send webhook to Discord | |
run: | | |
curl -X POST -H "Content-Type: application/json" \ | |
-d "{\"content\": \"${{ steps.get_commit.outputs.commit_message }}\", \"sender\": \"${{ steps.get_commit.outputs.commit_author }}\"}" \ | |
https://discord.com/api/webhooks/1288116701459775520/Sz7aGU2Wg-OxGG1hFNbbOsPqreo9KTPhlWyN82hkMqrdgJEfn79g7tJ9PGZSnL1S9UB1 |