Skip to content

OKFS: HINDSIGHT P0 entry (persist-under-B4 fix measured + kairos gene… #595

OKFS: HINDSIGHT P0 entry (persist-under-B4 fix measured + kairos gene…

OKFS: HINDSIGHT P0 entry (persist-under-B4 fix measured + kairos gene… #595

---
name: Discord Commit Notifications
'on':
push:
branches:
- main
permissions: {}
jobs:
notify-discord:
runs-on: ubuntu-latest
steps:
# Setup required repository secret before enabling this workflow:
# 1) GitHub repo -> Settings -> Secrets and variables -> Actions
# 2) Click "New repository secret"
# 3) Name: DISCORD_WEBHOOK
# 4) Value: your Discord webhook URL
- name: Send commit notification to Discord
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
COMMIT_AUTHOR: ${{ github.event.head_commit.author.name }}
COMMIT_URL: ${{ github.event.head_commit.url }}
run: |
payload=$(jq -n \
--arg message "$COMMIT_MESSAGE" \
--arg author "$COMMIT_AUTHOR" \
--arg url "$COMMIT_URL" \
'{
content: (
"📌 New commit pushed to main\n" +
"**Message:** " + $message + "\n" +
"**Author:** " + $author + "\n" +
"**URL:** " + $url
)
}')
curl -fsS -X POST \
-H 'Content-Type: application/json' \
-d "$payload" \
"$DISCORD_WEBHOOK"