Merge branch 'master' of https://github.com/PranshulGG/WeatherMaster #10
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: Send Commit Messages to Discord | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
notify-discord: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Send Commit to Discord | |
env: | |
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
run: | | |
LAST_COMMIT_MESSAGE=$(git log -1 --pretty=format:'%s') | |
LAST_COMMIT_AUTHOR=$(git log -1 --pretty=format:'%an') | |
REPO_NAME=${{ github.repository }} | |
ACTOR=${{ github.actor }} | |
BRANCH=${{ github.ref_name }} | |
curl -X POST -H "Content-Type: application/json" \ | |
-d "{ | |
\"content\": \"${LAST_COMMIT_AUTHOR} pushed to ${REPO_NAME} on branch ${BRANCH}: ${LAST_COMMIT_MESSAGE}\" | |
}" \ | |
$DISCORD_WEBHOOK |