mirror of
https://github.com/appleboy/telegram-action.git
synced 2026-06-28 14:27:55 +00:00
Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a77dd3e42f | |||
| 2e9996f96e | |||
| 2efd23283a | |||
| a5d86cddbc | |||
| f384cb685b | |||
| ed144893ba | |||
| beaf02496b | |||
| 6ecbcc43b0 | |||
| dc870f34e9 | |||
| 6cdf58fd81 | |||
| 1ecd8d50e4 | |||
| 9e5e0be372 | |||
| 0e7bbc5ef7 | |||
| 3295af7b78 | |||
| 12a87fd2ec | |||
| ec18563cbb | |||
| d23549b68a | |||
| 18c4142dfa | |||
| c05923bdec | |||
| 50dd6d184f | |||
| 68616a84f7 | |||
| f501e27814 | |||
| 867844f8a4 | |||
| abd0142ad9 | |||
| 363157132e | |||
| d0bf9f621b | |||
| 1ac4b1171b |
+55
-13
@@ -8,27 +8,33 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@master
|
||||||
- name: send custom message with args
|
- name: send custom message with args
|
||||||
uses: appleboy/telegram-action@master
|
uses: ./
|
||||||
with:
|
with:
|
||||||
to: ${{ secrets.TELEGRAM_TO }}
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
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 using with
|
||||||
uses: appleboy/telegram-action@master
|
uses: ./
|
||||||
with:
|
with:
|
||||||
to: ${{ secrets.TELEGRAM_TO }}
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
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 variable ref: ${{ github.ref }}
|
||||||
|
show the github variable commit: ${{ github.sha }}
|
||||||
|
show the github variable ref: {{ commit.ref }}
|
||||||
|
show the github variable commit: {{ commit.sha }}
|
||||||
|
Commit Message: ${{ github.event.head_commit.message }}
|
||||||
|
|
||||||
- name: send default message
|
- name: send default message
|
||||||
uses: appleboy/telegram-action@master
|
uses: ./
|
||||||
with:
|
with:
|
||||||
to: ${{ secrets.TELEGRAM_TO }}
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
|
|
||||||
- name: send photo message
|
- name: send photo message
|
||||||
uses: appleboy/telegram-action@master
|
uses: ./
|
||||||
with:
|
with:
|
||||||
to: ${{ secrets.TELEGRAM_TO }}
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
@@ -37,7 +43,7 @@ jobs:
|
|||||||
document: './tests/gophercolor.png'
|
document: './tests/gophercolor.png'
|
||||||
|
|
||||||
- name: send location message
|
- name: send location message
|
||||||
uses: appleboy/telegram-action@master
|
uses: ./
|
||||||
with:
|
with:
|
||||||
to: ${{ secrets.TELEGRAM_TO }}
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
@@ -45,7 +51,7 @@ jobs:
|
|||||||
venue: '35.661777 139.704051 竹北體育館 新竹縣竹北市'
|
venue: '35.661777 139.704051 竹北體育館 新竹縣竹北市'
|
||||||
|
|
||||||
- name: send custom message
|
- name: send custom message
|
||||||
uses: appleboy/telegram-action@master
|
uses: ./
|
||||||
with:
|
with:
|
||||||
to: ${{ secrets.TELEGRAM_TO }}
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
@@ -54,16 +60,52 @@ jobs:
|
|||||||
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
|
- name: send message file
|
||||||
uses: appleboy/telegram-action@master
|
uses: ./
|
||||||
with:
|
with:
|
||||||
to: ${{ secrets.TELEGRAM_TO }}
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
message_file: tests/message.txt
|
message_file: tests/message.txt
|
||||||
|
|
||||||
- name: send message using socks5 proxy URL
|
# - name: send message using socks5 proxy URL
|
||||||
uses: appleboy/telegram-action@master
|
# 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 }}
|
||||||
|
|
||||||
|
- name: link preview
|
||||||
|
uses: ./
|
||||||
with:
|
with:
|
||||||
to: ${{ secrets.TELEGRAM_TO }}
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
socks5: "http://222.124.154.19:23500"
|
message: |
|
||||||
message: Send message from socks5 proxy URL.
|
show link preview https://google.com.tw
|
||||||
|
|
||||||
|
- name: disable link preview
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
|
disable_web_page_preview: true
|
||||||
|
message: |
|
||||||
|
disable link preview https://google.com.tw
|
||||||
|
|
||||||
|
- name: sending a message without notification
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
|
disable_notification: true
|
||||||
|
message: |
|
||||||
|
disable link preview https://google.com.tw
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
FROM appleboy/drone-telegram:1.3.5-linux-amd64
|
FROM appleboy/drone-telegram:1.4.0
|
||||||
|
|
||||||
ADD entrypoint.sh /entrypoint.sh
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
RUN chmod +x /entrypoint.sh
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
||||||
WORKDIR /github/workspace
|
WORKDIR /github/workspace
|
||||||
|
|||||||
@@ -8,7 +8,9 @@
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Send custom message and see the custom variable as blow.
|
**NOTE**: If you are getting "Error: Chat not found", then you need to look at this stackoverflow's answer [here](https://stackoverflow.com/a/41291666).
|
||||||
|
|
||||||
|
Send custom message and see the custom variable as below.
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
name: telegram message
|
name: telegram message
|
||||||
@@ -19,13 +21,18 @@ jobs:
|
|||||||
name: Build
|
name: Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- name: send telegram message on push
|
||||||
- name: send custom message with args
|
uses: appleboy/telegram-action@master
|
||||||
uses: appleboy/telegram-action@master
|
with:
|
||||||
with:
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
to: ${{ secrets.TELEGRAM_TO }}
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
message: |
|
||||||
args: The ${{ github.event_name }} event triggered first step.
|
${{ github.actor }} created commit:
|
||||||
|
Commit message: ${{ github.event.commits[0].message }}
|
||||||
|
|
||||||
|
Repository: ${{ github.repository }}
|
||||||
|
|
||||||
|
See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}}
|
||||||
```
|
```
|
||||||
|
|
||||||
Remove `args` to send the default message.
|
Remove `args` to send the default message.
|
||||||
@@ -52,8 +59,11 @@ Remove `args` to send the default message.
|
|||||||
* venue - optional. venue message
|
* venue - optional. venue 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`. 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.
|
* message_file - optional. overwrite the default message template with the contents of the specified file.
|
||||||
|
* disable_web_page_preview - optional. disables link previews for links in this message. default is `false`.
|
||||||
|
* disable_notification - optional. disables notifications for this message, supports sending a message without notification. default is `false`.
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
@@ -83,20 +93,7 @@ send location message:
|
|||||||
venue: '35.661777 139.704051 竹北體育館 新竹縣竹北市'
|
venue: '35.661777 139.704051 竹北體育館 新竹縣竹北市'
|
||||||
```
|
```
|
||||||
|
|
||||||
send custom message:
|
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 custom message
|
|
||||||
uses: appleboy/telegram-action@master
|
|
||||||
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
|
```yml
|
||||||
- name: send message using socks5 proxy URL
|
- name: send message using socks5 proxy URL
|
||||||
|
|||||||
@@ -32,6 +32,10 @@ inputs:
|
|||||||
description: 'enable debug mode.'
|
description: 'enable debug mode.'
|
||||||
format:
|
format:
|
||||||
description: 'message format: markdown or html'
|
description: 'message format: markdown or html'
|
||||||
|
disable_web_page_preview:
|
||||||
|
description: 'disables link previews for links in this message'
|
||||||
|
disable_notification:
|
||||||
|
description: 'disables notifications for this message, supports sending a message without notification,'
|
||||||
runs:
|
runs:
|
||||||
using: 'docker'
|
using: 'docker'
|
||||||
image: 'Dockerfile'
|
image: 'Dockerfile'
|
||||||
|
|||||||
Reference in New Issue
Block a user