Update README.md #72
This file contains hidden or 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 Any Push | |
| on: | |
| push: | |
| jobs: | |
| notify: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Send commit to Discord | |
| env: | |
| COMMIT_MSG: ${{ github.event.head_commit.message }} | |
| ACTOR: ${{ github.actor }} | |
| BRANCH: ${{ github.ref_name }} | |
| WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
| run: | | |
| jq -n --arg msg "$COMMIT_MSG" --arg actor "$ACTOR" --arg branch "$BRANCH" \ | |
| '{content: ("**New commit by " + $actor + "** on `" + $branch + "`\n" + $msg)}' \ | |
| > payload.json | |
| curl -H "Content-Type: application/json" -X POST -d @payload.json "$WEBHOOK" |