Skip to content

Commit 28300cc

Browse files
committed
Testing for Telegram Monitor bot
1 parent 4e4664d commit 28300cc

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/telegram_notify.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,19 @@ jobs:
1212
steps:
1313
- name: Send message to Telegram
1414
run: |
15+
FULL_MSG="${{ github.event.head_commit.message }}"
16+
HEADER=$(echo "$FULL_MSG" | head -n 1)
17+
DESC=$(echo "$FULL_MSG" | tail -n +2 | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
18+
if [ -z "$DESC" ]; then DESC="No description provided"; fi
1519
curl -s -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_MONITOR_TOKEN }}/sendMessage" \
1620
-d chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" \
1721
-d parse_mode="HTML" \
1822
-d disable_web_page_preview="true" \
1923
-d text="👤 User <a href='https://github.com/${{ github.actor }}'>${{ github.actor }}</a> committed into 📁 <b>${{ github.repository }}</b>
20-
21-
<b>Commit header:</b> ${{ github.event.head_commit.message }}
22-
24+
25+
<b>Commit header:</b> $HEADER
26+
<b>Commit description:</b> <i>$DESC</i>
27+
2328
🔗 <a href='https://github.com/${{ github.repository }}'>Link to repository</a>
2429
🔗 <a href='${{ github.event.head_commit.url }}'>Link to commit</a>
2530
🔗 <a href='https://github.com/${{ github.actor }}'>Link to user profile</a>

0 commit comments

Comments
 (0)