-
Notifications
You must be signed in to change notification settings - Fork 2
32 lines (27 loc) · 1.05 KB
/
notify-telegram.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: Notify Telegram on Branch Update
on:
push:
branches:
- 'master'
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get commit message
id: get_commit
run: |
echo "COMMIT_MESSAGE=$(git log -1 --pretty=format:'%s')" >> $GITHUB_ENV
echo "COMMIT_DESCRIPTION=$(git log -1 --pretty=format:'%b')" >> $GITHUB_ENV
- name: Send message to Telegram
env:
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
THREAD_ID: ${{ secrets.THREAD_ID }}
COMMIT_MESSAGE: ${{ env.COMMIT_MESSAGE }}
run: |
MESSAGE="""Скрипт обновлен Linea Culture для минта NFT.
Ссылка на гит: https://github.com/MaxZarev/linea_culture
Message: ${COMMIT_MESSAGE}"""
curl -s -X POST https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage -d chat_id=${TELEGRAM_CHAT_ID} -d text="${MESSAGE}" -d message_thread_id=${THREAD_ID}