mirror of
https://github.com/appleboy/telegram-action.git
synced 2026-05-14 02:42:44 +00:00
Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 845086369b | |||
| 268d7f7856 | |||
| 7ba2054f08 | |||
| d04c916137 | |||
| df78a5d925 | |||
| 94223af513 | |||
| deae8157b2 | |||
| 74d1289afd | |||
| 65a4c9fc42 | |||
| ee6f548104 | |||
| 62444e6582 | |||
| 406cbeb82a | |||
| a5e94a4245 | |||
| 40cbdc99a4 | |||
| ac4245365c | |||
| 06cc7371ce | |||
| b535a89bc8 | |||
| 696643cdf6 | |||
| bd65e6f3ea |
+29
-19
@@ -6,54 +6,64 @@ jobs:
|
|||||||
name: Build
|
name: Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- uses: actions/checkout@master
|
||||||
- name: send custom message with args
|
- name: send custom message with args
|
||||||
uses: appleboy/telegram-action@master
|
uses: appleboy/telegram-action@master
|
||||||
env:
|
|
||||||
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
|
|
||||||
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
|
|
||||||
with:
|
with:
|
||||||
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
args: The ${{ github.event_name }} event triggered first step.
|
args: The ${{ github.event_name }} event triggered first step.
|
||||||
|
|
||||||
- name: send message useing with
|
- name: send message useing with
|
||||||
uses: appleboy/telegram-action@master
|
uses: appleboy/telegram-action@master
|
||||||
env:
|
|
||||||
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
|
|
||||||
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
|
|
||||||
with:
|
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.
|
||||||
|
|
||||||
- name: send default message
|
- name: send default message
|
||||||
uses: appleboy/telegram-action@master
|
uses: appleboy/telegram-action@master
|
||||||
env:
|
with:
|
||||||
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
|
|
||||||
- name: send photo message
|
- name: send photo message
|
||||||
uses: appleboy/telegram-action@master
|
uses: appleboy/telegram-action@master
|
||||||
with:
|
with:
|
||||||
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
message: send photo message
|
message: send photo message
|
||||||
photo: './tests/github.png'
|
photo: './tests/github.png'
|
||||||
document: './tests/gophercolor.png'
|
document: './tests/gophercolor.png'
|
||||||
env:
|
|
||||||
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
|
|
||||||
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
|
|
||||||
|
|
||||||
- name: send location message
|
- name: send location message
|
||||||
uses: appleboy/telegram-action@master
|
uses: appleboy/telegram-action@master
|
||||||
with:
|
with:
|
||||||
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
location: '24.9163213 121.1424972'
|
location: '24.9163213 121.1424972'
|
||||||
venue: '35.661777 139.704051 竹北體育館 新竹縣竹北市'
|
venue: '35.661777 139.704051 竹北體育館 新竹縣竹北市'
|
||||||
env:
|
|
||||||
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
|
|
||||||
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
|
|
||||||
|
|
||||||
- name: send custom message
|
- name: send custom message
|
||||||
uses: appleboy/telegram-action@master
|
uses: appleboy/telegram-action@master
|
||||||
env:
|
|
||||||
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
|
|
||||||
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
|
|
||||||
with:
|
with:
|
||||||
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
message: |
|
message: |
|
||||||
The ${{ github.event_name }} event triggered final step.
|
The ${{ github.event_name }} event triggered final step.
|
||||||
echo This event is a pull request that had an assignee removed.
|
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
@@ -1,4 +1,4 @@
|
|||||||
FROM appleboy/drone-telegram:1.3.1-linux-amd64
|
FROM appleboy/drone-telegram:1.3.5-linux-amd64
|
||||||
|
|
||||||
ADD entrypoint.sh /entrypoint.sh
|
ADD entrypoint.sh /entrypoint.sh
|
||||||
RUN chmod +x /entrypoint.sh
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|||||||
@@ -1,23 +1,31 @@
|
|||||||
# 🚀 Telegram for GitHub Actions
|
# 🚀 Telegram for GitHub Actions
|
||||||
|
|
||||||
[GitHub Action](https://developer.github.com/actions/) for sending a Telegram notification message.
|
[GitHub Action](https://github.com/features/actions) for sending a Telegram notification message.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
[](https://github.com/appleboy/facebook-action/actions)
|
[](https://github.com/appleboy/telegram-action/actions)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Send custom message and see the custom variable as blow.
|
Send custom message and see the custom variable as blow.
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
- name: send custom message
|
name: telegram message
|
||||||
uses: appleboy/telegram-action@master
|
on: [push]
|
||||||
env:
|
jobs:
|
||||||
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
|
|
||||||
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
|
build:
|
||||||
with:
|
name: Build
|
||||||
args: The ${{ github.event_name }} event triggered first step.
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@master
|
||||||
|
- name: send custom message with args
|
||||||
|
uses: appleboy/telegram-action@master
|
||||||
|
with:
|
||||||
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
|
args: The ${{ github.event_name }} event triggered first step.
|
||||||
```
|
```
|
||||||
|
|
||||||
Remove `args` to send the default message.
|
Remove `args` to send the default message.
|
||||||
@@ -25,15 +33,16 @@ Remove `args` to send the default message.
|
|||||||
```yml
|
```yml
|
||||||
- name: send default message
|
- name: send default message
|
||||||
uses: appleboy/telegram-action@master
|
uses: appleboy/telegram-action@master
|
||||||
env:
|
with:
|
||||||
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Input variables
|
## Input variables
|
||||||
|
|
||||||
|
* socks5 - optional. support socks5 proxy URL
|
||||||
* photo - optional. photo message
|
* photo - optional. photo message
|
||||||
* document - optional. document message
|
* document - optional. document message
|
||||||
* sticker - optional. sticker message
|
* sticker - optional. sticker message
|
||||||
@@ -44,21 +53,22 @@ Remove `args` to send the default message.
|
|||||||
* video - optional. video message
|
* video - optional. video message
|
||||||
* debug - optional. enable debug mode
|
* debug - optional. enable debug mode
|
||||||
* format - optional. `markdown` or `html`
|
* 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:
|
send photo message:
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
|
- uses: actions/checkout@master
|
||||||
- name: send photo message
|
- name: send photo message
|
||||||
uses: appleboy/telegram-action@master
|
uses: appleboy/telegram-action@master
|
||||||
with:
|
with:
|
||||||
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
message: send photo message
|
message: send photo message
|
||||||
photo: tests/github.png
|
photo: tests/github.png
|
||||||
document: tests/gophercolor.png
|
document: tests/gophercolor.png
|
||||||
env:
|
|
||||||
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
|
|
||||||
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
send location message:
|
send location message:
|
||||||
@@ -67,11 +77,10 @@ send location message:
|
|||||||
- name: send location message
|
- name: send location message
|
||||||
uses: appleboy/telegram-action@master
|
uses: appleboy/telegram-action@master
|
||||||
with:
|
with:
|
||||||
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
location: '24.9163213 121.1424972'
|
location: '24.9163213 121.1424972'
|
||||||
venue: '35.661777 139.704051 竹北體育館 新竹縣竹北市'
|
venue: '35.661777 139.704051 竹北體育館 新竹縣竹北市'
|
||||||
env:
|
|
||||||
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
|
|
||||||
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
send custom message:
|
send custom message:
|
||||||
@@ -79,21 +88,32 @@ send custom message:
|
|||||||
```yml
|
```yml
|
||||||
- name: send custom message
|
- name: send custom message
|
||||||
uses: appleboy/telegram-action@master
|
uses: appleboy/telegram-action@master
|
||||||
env:
|
|
||||||
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
|
|
||||||
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
|
|
||||||
with:
|
with:
|
||||||
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
message: |
|
message: |
|
||||||
The ${{ github.event_name }} event triggered final step.
|
The ${{ github.event_name }} event triggered final step.
|
||||||
echo This event is a pull request that had an assignee removed.
|
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
|
## Secrets
|
||||||
|
|
||||||
Getting started with [Telegram Bot API](https://core.telegram.org/bots/api).
|
Getting started with [Telegram Bot API](https://core.telegram.org/bots/api).
|
||||||
|
|
||||||
* `TELEGRAM_TOKEN`: Telegram authorization token.
|
* `token`: Telegram authorization token.
|
||||||
* `TELEGRAM_TO`: Unique identifier for this chat.
|
* `to`: Unique identifier for this chat.
|
||||||
|
|
||||||
How to get unique identifier from telegram api:
|
How to get unique identifier from telegram api:
|
||||||
|
|
||||||
|
|||||||
+10
@@ -2,6 +2,16 @@ name: 'Telegram Message Notify'
|
|||||||
description: 'Sending a Telegram message'
|
description: 'Sending a Telegram message'
|
||||||
author: 'Bo-Yi Wu'
|
author: 'Bo-Yi Wu'
|
||||||
inputs:
|
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:
|
photo:
|
||||||
description: 'send the photo message.'
|
description: 'send the photo message.'
|
||||||
document:
|
document:
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
Sample message loaded from file.
|
||||||
|
|
||||||
|
Commit msg: {{commit.message}}
|
||||||
Reference in New Issue
Block a user