Skip to content

Commit 4940cc2

Browse files
adjust telegram notifications
1 parent 62c76a7 commit 4940cc2

File tree

2 files changed

+36
-3
lines changed

2 files changed

+36
-3
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Telegram Notifications
2+
3+
on:
4+
5+
issue_comment:
6+
types: [created]
7+
8+
jobs:
9+
notify:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Send notifications to Telegram
15+
run: >
16+
curl -s
17+
-X POST https://api.telegram.org/bot${{ secrets.TELEGRAM_NOTIFIER_BOT_TOKEN }}/sendMessage
18+
-d chat_id=${{ secrets.TELEGRAM_ALBERT_CHAT_ID }}
19+
-d text="${MESSAGE}"
20+
-d parse_mode=HTML
21+
-d disable_web_page_preview=true
22+
>> /dev/null
23+
env:
24+
MESSAGE: "<b>${{ github.event.comment.user.login }}</b> on <a href=\"${{ github.event.comment.html_url }}\"><b>${{ github.event.repository.name }}#${{ github.event.issue.number }}</b>: <i>${{ github.event.issue.title }}</i></a>%0A${{ github.event.comment.body }}"
25+

.github/workflows/telegram_notify_issues.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Telegram Notifications
22

33
on:
44
issues:
5-
types: [opened, reopened, deleted, closed]
5+
types: [opened, reopened]
66

77
jobs:
88
notify:
@@ -11,6 +11,14 @@ jobs:
1111

1212
steps:
1313
- name: Send notifications to Telegram
14-
run: curl -s -X POST https://api.telegram.org/bot${{ secrets.TELEGRAM_NOTIFIER_BOT_TOKEN }}/sendMessage -d chat_id=${{ secrets.TELEGRAM_ALBERT_CHAT_ID }} -d text="${MESSAGE}" >> /dev/null
14+
run: >
15+
curl -s
16+
-X POST https://api.telegram.org/bot${{ secrets.TELEGRAM_NOTIFIER_BOT_TOKEN }}/sendMessage
17+
-d chat_id=${{ secrets.TELEGRAM_ALBERT_CHAT_ID }}
18+
-d text="${MESSAGE}"
19+
-d parse_mode=HTML
20+
-d disable_web_page_preview=true
21+
>> /dev/null
1522
env:
16-
MESSAGE: "Issue ${{ github.event.action }}: \n${{ github.event.issue.html_url }}"
23+
MESSAGE: "New issue:%0A<a href=\"${{ github.event.issue.html_url }}\"><b>${{ github.event.repository.name }}#${{ github.event.issue.number }}</b>: <i>${{ github.event.issue.title }}</i></a>"
24+

0 commit comments

Comments
 (0)