Skip to content

Commit 9bdac0b873d7042df0dab920d1752022aeaadd1b notification (@Sheridan) #26

Commit 9bdac0b873d7042df0dab920d1752022aeaadd1b notification (@Sheridan)

Commit 9bdac0b873d7042df0dab920d1752022aeaadd1b notification (@Sheridan) #26

name: Notify on Commit
run-name: Commit ${{ github.sha }} notification (@${{ github.actor }})
on:
push:
branches:
- '**'
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Send commit information to Telegram
run: |
COMMIT_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}"
MESSAGE="🔖 New [commit](${COMMIT_URL}) pushed to branch \`${GITHUB_REF_NAME}\` by ${GITHUB_ACTOR} with message: \`${{ github.event.head_commit.message }}\`"
curl -s -X POST \
"https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/sendMessage" \
-d chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" \
-d parse_mode="Markdown" \
--data-urlencode text="$MESSAGE"