Skip to content

Instantly share code, notes, and snippets.

@alipandidan
Created October 8, 2020 23:02
Show Gist options
  • Save alipandidan/9f074edcdb420d05fb05496248f61d09 to your computer and use it in GitHub Desktop.
Save alipandidan/9f074edcdb420d05fb05496248f61d09 to your computer and use it in GitHub Desktop.
Telegram notification git hook
COMMITS=$(git --no-pager log origin/master..HEAD --format="- [%h] %B")
API_URL="https://api.telegram.org/bot${BOT_TOKEN}/sendMessage?chat_id=${CHAT_ID}"
curl --silent -o /dev/null \
--header "Content-Type: application/json" \
--request POST \
--data "{\"text\": \"${COMMITS}\"}" \
$API_URL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment