mirror of
https://github.com/appleboy/telegram-action.git
synced 2026-05-14 02:42:44 +00:00
Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 12a87fd2ec | |||
| ec18563cbb | |||
| d23549b68a | |||
| 18c4142dfa | |||
| c05923bdec | |||
| 50dd6d184f | |||
| 68616a84f7 | |||
| f501e27814 | |||
| 867844f8a4 | |||
| abd0142ad9 | |||
| 363157132e | |||
| d0bf9f621b | |||
| 1ac4b1171b | |||
| 845086369b | |||
| 268d7f7856 | |||
| 7ba2054f08 | |||
| d04c916137 | |||
| df78a5d925 | |||
| 94223af513 | |||
| deae8157b2 | |||
| 74d1289afd |
@@ -19,7 +19,12 @@ jobs:
|
||||
with:
|
||||
to: ${{ secrets.TELEGRAM_TO }}
|
||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||
message: The ${{ github.event_name }} event triggered second step.
|
||||
message: |
|
||||
The ${{ github.event_name }} event triggered second step.
|
||||
show the github varable ref: ${{ github.ref }}
|
||||
show the github varable commit: ${{ github.sha }}
|
||||
show the github varable ref: {{ commit.ref }}
|
||||
show the github varable commit: {{ commit.sha }}
|
||||
|
||||
- name: send default message
|
||||
uses: appleboy/telegram-action@master
|
||||
@@ -59,3 +64,20 @@ jobs:
|
||||
to: ${{ secrets.TELEGRAM_TO }}
|
||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||
message_file: tests/message.txt
|
||||
|
||||
# - name: send message using socks5 proxy URL
|
||||
# uses: appleboy/telegram-action@master
|
||||
# with:
|
||||
# to: ${{ secrets.TELEGRAM_TO }}
|
||||
# token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||
# socks5: "http://222.124.154.19:23500"
|
||||
# message: Send message from socks5 proxy URL.
|
||||
- name: try multiple message
|
||||
uses: appleboy/telegram-action@master
|
||||
with:
|
||||
to: ${{ secrets.TELEGRAM_TO }}
|
||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||
format: html
|
||||
message: |
|
||||
⚡️ <a href="https://github.com/aszenz/repo/commit/${{ github.event.push.after }}">Commits</a> pushed to master by <em>${{ github.event.push.pusher.name }}</em> ⚡️
|
||||
${{ github.actor }}:${{ github.event.head_commit.message }}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
FROM appleboy/drone-telegram:1.3.4-linux-amd64
|
||||
FROM appleboy/drone-telegram:1.3.6-linux-amd64
|
||||
|
||||
ADD entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
@@ -22,10 +22,9 @@ jobs:
|
||||
- uses: actions/checkout@master
|
||||
- name: send custom message with args
|
||||
uses: appleboy/telegram-action@master
|
||||
env:
|
||||
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
|
||||
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
|
||||
with:
|
||||
to: ${{ secrets.TELEGRAM_TO }}
|
||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||
args: The ${{ github.event_name }} event triggered first step.
|
||||
```
|
||||
|
||||
@@ -34,15 +33,16 @@ Remove `args` to send the default message.
|
||||
```yml
|
||||
- name: send default message
|
||||
uses: appleboy/telegram-action@master
|
||||
env:
|
||||
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
|
||||
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
|
||||
with:
|
||||
to: ${{ secrets.TELEGRAM_TO }}
|
||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||
```
|
||||
|
||||

|
||||
|
||||
## Input variables
|
||||
|
||||
* socks5 - optional. support socks5 proxy URL
|
||||
* photo - optional. photo message
|
||||
* document - optional. document message
|
||||
* sticker - optional. sticker message
|
||||
@@ -52,10 +52,11 @@ Remove `args` to send the default message.
|
||||
* venue - optional. venue message
|
||||
* video - optional. video message
|
||||
* debug - optional. enable debug mode
|
||||
* format - optional. `markdown` or `html`
|
||||
* format - optional. `markdown` or `html`. See [MarkdownV2 style](https://core.telegram.org/bots/api#markdownv2-style)
|
||||
* message - optional. custom message
|
||||
* message_file - optional. overwrite the default message template with the contents of the specified file.
|
||||
|
||||
### Example
|
||||
## Example
|
||||
|
||||
send photo message:
|
||||
|
||||
@@ -64,12 +65,11 @@ send photo message:
|
||||
- name: send photo message
|
||||
uses: appleboy/telegram-action@master
|
||||
with:
|
||||
to: ${{ secrets.TELEGRAM_TO }}
|
||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||
message: send photo message
|
||||
photo: tests/github.png
|
||||
document: tests/gophercolor.png
|
||||
env:
|
||||
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
|
||||
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
|
||||
```
|
||||
|
||||
send location message:
|
||||
@@ -78,11 +78,10 @@ send location message:
|
||||
- name: send location message
|
||||
uses: appleboy/telegram-action@master
|
||||
with:
|
||||
to: ${{ secrets.TELEGRAM_TO }}
|
||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||
location: '24.9163213 121.1424972'
|
||||
venue: '35.661777 139.704051 竹北體育館 新竹縣竹北市'
|
||||
env:
|
||||
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
|
||||
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
|
||||
```
|
||||
|
||||
send custom message:
|
||||
@@ -90,21 +89,32 @@ send custom message:
|
||||
```yml
|
||||
- name: send custom message
|
||||
uses: appleboy/telegram-action@master
|
||||
env:
|
||||
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
|
||||
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
|
||||
with:
|
||||
to: ${{ secrets.TELEGRAM_TO }}
|
||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||
message: |
|
||||
The ${{ github.event_name }} event triggered final step.
|
||||
echo This event is a pull request that had an assignee removed.
|
||||
```
|
||||
|
||||
send message using custom proxy (support `http`, `https`, and `socks5`) like `socks5://127.0.0.1:1080` or `http://222.124.154.19:23500`
|
||||
|
||||
```yml
|
||||
- name: send message using socks5 proxy URL
|
||||
uses: appleboy/telegram-action@master
|
||||
with:
|
||||
to: ${{ secrets.TELEGRAM_TO }}
|
||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||
socks5: "http://222.124.154.19:23500"
|
||||
message: Send message from socks5 proxy URL.
|
||||
```
|
||||
|
||||
## Secrets
|
||||
|
||||
Getting started with [Telegram Bot API](https://core.telegram.org/bots/api).
|
||||
|
||||
* `TELEGRAM_TOKEN`: Telegram authorization token.
|
||||
* `TELEGRAM_TO`: Unique identifier for this chat.
|
||||
* `token`: Telegram authorization token.
|
||||
* `to`: Unique identifier for this chat.
|
||||
|
||||
How to get unique identifier from telegram api:
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@ inputs:
|
||||
description: 'telegram message'
|
||||
message_file:
|
||||
description: 'overwrite the default message template with the contents of the specified file'
|
||||
socks5:
|
||||
description: 'support socks5 proxy URL'
|
||||
photo:
|
||||
description: 'send the photo message.'
|
||||
document:
|
||||
|
||||
Reference in New Issue
Block a user