Skip to content

Update README.md

Update README.md #72

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"