2020-11-18 10:42:18 +01:00
|
|
|
name: Commit notification
|
2020-11-09 16:42:43 +01:00
|
|
|
|
2020-11-09 16:47:42 +01:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: ['*']
|
|
|
|
|
2020-11-09 16:42:43 +01:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Set short SHA
|
|
|
|
id: vars
|
|
|
|
run: echo "::set-output name=sha_short::$(echo ${GITHUB_SHA:0:7})"
|
|
|
|
- name: Telegram Notification
|
|
|
|
uses: appleboy/telegram-action@0.0.7
|
|
|
|
with:
|
2020-11-09 17:03:13 +01:00
|
|
|
message: 'A new commit [${{ steps.vars.outputs.sha_short }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }}) to [${{ github.repository }}](https://github.com/${{ github.repository }}) by [@${{ github.event.pusher.name }}](https://github.com/${{ github.event.pusher.name }})'
|
2020-11-09 16:42:43 +01:00
|
|
|
format: markdown
|
|
|
|
to: ${{ secrets.TELEGRAM_CHAT_ID }}
|
|
|
|
token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
|
2020-11-10 09:30:46 +01:00
|
|
|
# TODO
|
|
|
|
# 1. a separate file for this thing
|
|
|
|
# 2. on push, pull_request, issue, comment, etc
|
|
|
|
# 3. add event type to the message
|
|
|
|
# 4. list of commits in message if many pushed
|