13 Commits

Author SHA1 Message Date
Bo-Yi Wu 845086369b chore: upgrade drone-telegram to 1.3.5 2019-12-07 14:55:21 +08:00
Bo-Yi Wu 268d7f7856 docs: update secrets 2019-12-07 14:51:50 +08:00
Bo-Yi Wu 7ba2054f08 docs: add socks5 example 2019-12-07 14:45:02 +08:00
Bo-Yi Wu d04c916137 update format
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2019-12-07 14:37:56 +08:00
Bo-Yi Wu df78a5d925 update format
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2019-12-07 12:56:49 +08:00
Bo-Yi Wu 94223af513 chore: Send message using custom socks5 proxy url 2019-12-07 12:51:57 +08:00
Bo-Yi Wu deae8157b2 docs: update header 2019-11-16 17:52:50 +08:00
Bo-Yi Wu 74d1289afd docs: update 2019-11-02 15:20:17 +08:00
Bo-Yi Wu 65a4c9fc42 chore: add test in file template 2019-11-02 14:52:07 +08:00
Bo-Yi Wu ee6f548104 chore: update format 2019-11-02 14:50:12 +08:00
Bo-Yi Wu 62444e6582 chore: add message_file 2019-11-02 14:33:19 +08:00
Bo-Yi Wu 406cbeb82a chore: upgrade to 1.3.4 2019-11-02 14:24:25 +08:00
Bo-Yi Wu a5e94a4245 docs: update status link 2019-10-13 01:30:14 +08:00
5 changed files with 71 additions and 38 deletions
+28 -18
View File
@@ -9,51 +9,61 @@ 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.
- name: send message useing with
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 second step.
- 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 }}
- 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 }}
- 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 }}
- 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.
- name: send message file
uses: appleboy/telegram-action@master
with:
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.
+1 -1
View File
@@ -1,4 +1,4 @@
FROM appleboy/drone-telegram:1.3.2-linux-amd64
FROM appleboy/drone-telegram:1.3.5-linux-amd64
ADD entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
+29 -19
View File
@@ -4,7 +4,7 @@
![notification](./images/telegram-notification.png)
[![Actions Status](https://github.com/appleboy/telegram-action/workflows/telegram%20message/badge.svg)](https://github.com/appleboy/facebook-action/actions)
[![Actions Status](https://github.com/appleboy/telegram-action/workflows/telegram%20message/badge.svg)](https://github.com/appleboy/telegram-action/actions)
## Usage
@@ -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 }}
```
![workflow](./images/telegram-workflow.png)
## Input variables
* socks5 - optional. support socks5 proxy URL
* photo - optional. photo message
* document - optional. document message
* sticker - optional. sticker message
@@ -53,8 +53,9 @@ Remove `args` to send the default message.
* video - optional. video message
* debug - optional. enable debug mode
* format - optional. `markdown` or `html`
* message_file - optional. overwrite the default message template with the contents of the specified file.
### Example
## Example
send photo message:
@@ -63,12 +64,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:
@@ -77,11 +77,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:
@@ -89,21 +88,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`)
```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
View File
@@ -2,6 +2,16 @@ name: 'Telegram Message Notify'
description: 'Sending a Telegram message'
author: 'Bo-Yi Wu'
inputs:
to:
description: 'telegram user'
token:
description: 'telegram token'
message:
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:
+3
View File
@@ -0,0 +1,3 @@
Sample message loaded from file.
Commit msg: {{commit.message}}