Skip to content

Commit 0acc352

Browse files
committed
chore: update readme
1 parent c56361b commit 0acc352

File tree

1 file changed

+45
-2
lines changed

1 file changed

+45
-2
lines changed

README.md

+45-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,45 @@
1-
# tgate-action
2-
A Github action plugin to send notification to telegram
1+
# GitHub Action: Telegram Event Notifier
2+
3+
This GitHub Action sends GitHub events as messages to a Telegram chat or channel or group or a specific topic in a group or thread.
4+
5+
## Usage
6+
7+
To use this GitHub Action, you need to have a Telegram bot token and a chat ID.
8+
9+
1. Create a new Telegram bot by talking to the [BotFather](https://t.me/BotFather) on Telegram and follow the instructions to obtain the bot token.
10+
11+
2. Find out the chat ID where you want to receive the event messages. You can use the [getUpdates](https://core.telegram.org/bots/api#getupdates) API method or search for the bot username in the Telegram app to get the chat ID.
12+
13+
3. In your GitHub repository, create a new workflow file (e.g., `.github/workflows/telegram-event-notifier.yml`) and define the following:
14+
15+
```yaml
16+
name: Telegram Gate
17+
18+
on:
19+
issue_comment:
20+
types: created
21+
issues:
22+
types: [opened, edited, pinned, closed, reopened, assigned, labeled]
23+
pull_request:
24+
types:
25+
[opened, closed, edited, ready_for_review, review_requested, reopened]
26+
pull_request_review_comment:
27+
types: created
28+
push:
29+
30+
jobs:
31+
build:
32+
name: Telegram Gate
33+
runs-on: ubuntu-latest
34+
35+
steps:
36+
- name: Notifier
37+
uses: ethyaan/tgate-action
38+
if: always()
39+
with:
40+
token: ${{ secrets.token }} # savethe bot token at settings/secrets with name: token
41+
to: ${{ secrets.to }} # save your chat id at settings/secrets with name: chat
42+
thread_id: ${{secrets.threadid}} # set this for sending message in thread or group topic
43+
disable_web_page_preview: false # set this to true to disable link previw in telegram
44+
disable_notification: false # set tjis true to send message in silet mode
45+
```

0 commit comments

Comments
 (0)