File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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>
You can’t perform that action at this time.
0 commit comments