86 Commits

Author SHA1 Message Date
Abdullajonov Bobur 37056891d4 feat: Added support to sending message to group topic (#70) 2026-04-08 21:22:05 +08:00
Bo-Yi Wu 847a2d3240 chore(ci): update GitHub Actions dependencies to latest versions
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 12:06:40 +08:00
appleboy 1b2bf60368 docs: localize README to Traditional Chinese
- Fix a typo in the README.zh-tw.md file
- Translate English text to Traditional Chinese in the README.zh-tw.md file

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2024-11-20 22:33:56 +08:00
appleboy 95f03551fd docs: translate documentation sections to Chinese
- Translate input variables section to Chinese
- Translate example section to Chinese
- Translate specific message sending instructions to Chinese
- Translate Telegram Bot API getting started instructions to Chinese
- Translate template variable section to Chinese

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2024-11-20 22:28:31 +08:00
appleboy 85afa0fd9a docs: enhance internationalization and testing framework
- Add links to Traditional Chinese and Simplified Chinese README files

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2024-11-20 22:27:23 +08:00
appleboy 84183da9cf docs: add Chinese READMEs for GitHub Actions notifications
- Add a Chinese (Simplified) README for GitHub Actions Telegram notifications
- Add a Chinese (Traditional) README for GitHub Actions Telegram notifications

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2024-11-20 22:27:02 +08:00
appleboy 5010c012e9 docs: improve documentation consistency and clarity
- Fix minor grammatical errors and improve clarity in the README.md
- Capitalize the first letter of list items in the options table for consistency

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2024-11-20 22:26:53 +08:00
appleboy 94584eda62 docs: improve documentation formatting and API usage
- Convert the list of optional parameters to a table format for better readability
- Fix the table formatting in the "See the result" section

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2024-11-20 22:08:01 +08:00
appleboy 221e6b6849 build: switch to GitHub Container Registry for Docker images
- Update Dockerfile to use the GitHub Container Registry for the drone-telegram image

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2024-11-16 01:40:01 +08:00
appleboy 9177cafddc ci: implement automated release workflow with GoReleaser
- Add a GitHub Actions workflow for GoReleaser
- Configure GoReleaser to skip builds by default
- Set up changelog groups with specific regex patterns for categorizing changes

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2024-10-09 23:58:44 +08:00
appleboy 65a1d3c2f9 style: refactor CI configuration for consistency and clarity
- Update quotes from single to double in the CI configuration file
- Remove an empty line in the jobs section
- Adjust formatting for the photo and document paths

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2024-09-06 19:19:14 +08:00
appleboy a77dd3e42f chore: upgrade base image to version 1.4.0
- Update the base image version from 1.3.9 to 1.4.0

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2024-09-06 19:12:31 +08:00
Artem Avanesov 2e9996f96e Change custom message to be more meaningful/useful (#40) 2021-10-18 08:49:25 +08:00
Bo-Yi Wu 2efd23283a chore: bump drone-telegram to 1.3.9 2021-04-03 07:29:57 +08:00
Bo-Yi Wu a5d86cddbc chore: sending a message without notification
https://github.com/appleboy/telegram-action/issues/26
2021-04-03 06:44:51 +08:00
Sahil Rajput f384cb685b Update README.md (#31) 2021-03-18 21:26:13 +08:00
NiJia Lin ed144893ba fix typo (#29) 2021-02-16 01:22:15 +08:00
Bo-Yi Wu beaf02496b Update Dockerfile 2021-02-13 11:08:56 +08:00
Bo-Yi Wu 6ecbcc43b0 chore(github): add commit message example 2020-10-03 16:40:19 +08:00
Bo-Yi Wu dc870f34e9 chore: upgrade to 1.3.8 docker image 2020-10-03 16:33:44 +08:00
Bo-Yi Wu 6cdf58fd81 chore: use current action in testing 2020-10-03 16:23:46 +08:00
Bo-Yi Wu 1ecd8d50e4 refactor: disable_web_page_preview 2020-10-03 16:10:54 +08:00
Bo-Yi Wu 9e5e0be372 chore: support disable web page preview (#24) 2020-10-03 08:42:51 +08:00
Bo-Yi Wu 0e7bbc5ef7 Merge pull request #17 from crazyuploader/patch-1
Update README.md
2020-07-19 01:17:37 +08:00
Jugal Kishore 3295af7b78 Update README.md
Fix typo
2020-07-18 17:27:06 +05:30
Bo-Yi Wu 12a87fd2ec chore: upgrade drone-telegram to 1.3.6 2020-06-20 17:01:54 +08:00
Bo-Yi Wu ec18563cbb chore: update 2020-06-20 13:54:40 +08:00
Bo-Yi Wu d23549b68a add single testing
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-06-19 16:41:32 +08:00
Bo-Yi Wu 18c4142dfa add single testing
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-06-19 16:37:02 +08:00
Bo-Yi Wu c05923bdec add single testing
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-06-19 16:35:58 +08:00
Bo-Yi Wu 50dd6d184f add single testing
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-06-19 16:29:56 +08:00
Bo-Yi Wu 68616a84f7 Merge pull request #12 from appleboy/appleboy-patch-1 2020-05-22 09:17:00 +08:00
Bo-Yi Wu f501e27814 Add MarkdownV2 Link 2020-05-22 09:16:33 +08:00
Bo-Yi Wu 867844f8a4 docs: add message field.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-04-24 16:09:09 +08:00
Bo-Yi Wu abd0142ad9 add drone variable example
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-04-24 16:04:04 +08:00
Bo-Yi Wu 363157132e add sha example
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-04-24 16:03:22 +08:00
Bo-Yi Wu d0bf9f621b add github.ref example
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-04-24 16:01:05 +08:00
Bo-Yi Wu 1ac4b1171b docs: add socks5 and http proxy format 2019-12-08 07:22:20 +08:00
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
Bo-Yi Wu 40cbdc99a4 chore: upgrade drone-telegram 2019-10-13 00:12:05 +08:00
Bo-Yi Wu ac4245365c Update README.md 2019-09-30 11:37:12 +08:00
Bo-Yi Wu 06cc7371ce docs: update readme 2019-09-29 14:18:21 +08:00
Bo-Yi Wu b535a89bc8 docs: add checkout command 2019-09-28 11:19:32 +08:00
Bo-Yi Wu 696643cdf6 chore: checkout source code. 2019-09-28 11:17:35 +08:00
Bo-Yi Wu bd65e6f3ea docs: update badge url 2019-09-25 22:42:29 +08:00
Bo-Yi Wu 040616c1f8 chore: add drone telegram version 2019-09-25 22:39:32 +08:00
Bo-Yi Wu a10dfd2766 docs: add custom message 2019-09-25 22:12:11 +08:00
Bo-Yi Wu c83985c531 add custom message
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2019-09-25 22:09:04 +08:00
Bo-Yi Wu 2b5a500551 docs: add photo and location message 2019-09-25 22:04:09 +08:00
Bo-Yi Wu fdf386abfa docs: update location message 2019-09-25 22:02:38 +08:00
Bo-Yi Wu 4e83d473fc update
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2019-09-25 22:01:27 +08:00
Bo-Yi Wu a14c43a7be chore: add location message 2019-09-25 21:28:25 +08:00
Bo-Yi Wu 82f08879c5 docs: add location message 2019-09-25 21:22:36 +08:00
Bo-Yi Wu f622f39b03 chore: add location message 2019-09-25 21:21:38 +08:00
Bo-Yi Wu 89073d4db2 update
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2019-09-25 19:28:57 +08:00
Bo-Yi Wu 7952082356 update
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2019-09-25 19:27:38 +08:00
Bo-Yi Wu 4dbe08d34a update
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2019-09-25 19:25:53 +08:00
Bo-Yi Wu ffc52f02f2 update
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2019-09-25 19:23:28 +08:00
Bo-Yi Wu 8920bdffe3 update
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2019-09-25 19:20:36 +08:00
Bo-Yi Wu d1f5f0e4e9 add workspace
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2019-09-25 19:15:08 +08:00
Bo-Yi Wu cba7edda6f update
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2019-09-25 19:13:06 +08:00
Bo-Yi Wu 868c74871e add workdir
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2019-09-25 19:08:49 +08:00
Bo-Yi Wu 3fb31034d1 initial ci
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2019-09-25 18:59:58 +08:00
Bo-Yi Wu d753c01b96 update readme
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2019-09-25 18:58:09 +08:00
Bo-Yi Wu 6399a5ed49 upgrade github actions
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2019-09-25 18:53:47 +08:00
Bo-Yi Wu 0e92df9a00 add action yaml file.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2019-09-25 18:41:37 +08:00
Bo-Yi Wu 2df95b048f fixed Template typo (#3)
fixed Template typo
2019-04-26 09:46:49 +08:00
0xflotus bd94f12bb6 fixed Template typo 2019-04-24 18:09:13 +02:00
Bo-Yi Wu 827b11092f docs: update doc 2019-04-05 07:20:52 +08:00
Bo-Yi Wu dcd986dc36 Merge pull request #2 from appleboy/doc
docs: add Template variable
2019-04-05 07:14:33 +08:00
Bo-Yi Wu 27dde9c826 docs: add Template variable 2019-04-05 07:10:58 +08:00
Bo-Yi Wu cc178efb9f chore: add commit.sha in example 2019-04-05 06:48:58 +08:00
Bo-Yi Wu 8b27ddeb0a docs: add FORMAT env info 2019-02-28 15:09:39 +08:00
Bo-Yi Wu 1274de63b5 chore(workflow): add test message 2019-02-20 00:23:44 +08:00
10 changed files with 614 additions and 96 deletions
-36
View File
@@ -1,36 +0,0 @@
workflow "Send Notification" {
on = "push"
resolves = [
"Send Custom Message",
"Send Default Message"
]
}
action "Send Custom Message" {
uses = "appleboy/telegram-action@master"
secrets = [
"TELEGRAM_TOKEN",
"TELEGRAM_TO",
]
args = "A new commit has been pushed."
}
action "Send Default Message" {
uses = "appleboy/telegram-action@master"
secrets = [
"TELEGRAM_TOKEN",
"TELEGRAM_TO",
]
}
action "Send photo message" {
uses = "appleboy/telegram-action@master"
secrets = [
"TELEGRAM_TOKEN",
"TELEGRAM_TO",
]
env = {
PHOTO = "tests/github.png"
}
args = "A new commit has been pushed."
}
+110
View File
@@ -0,0 +1,110 @@
name: telegram message
on: [push]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: send custom message with args
uses: ./
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
args: The ${{ github.event_name }} event triggered first step.
- name: send message using with
uses: ./
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
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
uses: ./
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
- name: send photo message
uses: ./
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: send photo message
photo: "./tests/github.png"
document: "./tests/gophercolor.png"
- name: send location message
uses: ./
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
location: "24.9163213 121.1424972"
venue: "35.661777 139.704051 竹北體育館 新竹縣竹北市"
- name: send custom message
uses: ./
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: ./
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.
# - 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:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
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
+33
View File
@@ -0,0 +1,33 @@
name: Goreleaser
on:
push:
tags:
- "*"
permissions:
contents: write
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup go
uses: actions/setup-go@v6
with:
go-version: "^1"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v7
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+28
View File
@@ -0,0 +1,28 @@
builds:
- # If true, skip the build.
# Useful for library projects.
# Default is false
skip: true
changelog:
use: github
groups:
- title: Features
regexp: "^.*feat[(\\w)]*:+.*$"
order: 0
- title: "Bug fixes"
regexp: "^.*fix[(\\w)]*:+.*$"
order: 1
- title: "Enhancements"
regexp: "^.*chore[(\\w)]*:+.*$"
order: 2
- title: "Refactor"
regexp: "^.*refactor[(\\w)]*:+.*$"
order: 3
- title: "Build process updates"
regexp: ^.*?(build|ci)(\(.+\))??!?:.+$
order: 4
- title: "Documentation updates"
regexp: ^.*?docs?(\(.+\))??!?:.+$
order: 4
- title: Others
+5 -13
View File
@@ -1,16 +1,8 @@
FROM appleboy/drone-telegram:1.4.2-linux-amd64 FROM ghcr.io/appleboy/drone-telegram:1.4.0
# Github labels COPY entrypoint.sh /entrypoint.sh
LABEL "com.github.actions.name"="Telegram Notify"
LABEL "com.github.actions.description"="Sending a Telegram message"
LABEL "com.github.actions.icon"="message-square"
LABEL "com.github.actions.color"="blue"
LABEL "repository"="https://github.com/appleboy/telegram-action"
LABEL "homepage"="https://github.com/appleboy"
LABEL "maintainer"="Bo-Yi Wu <appleboy.tw@gmail.com>"
LABEL "version"="0.0.2"
ADD entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh RUN chmod +x /entrypoint.sh
WORKDIR /github/workspace
ENTRYPOINT ["/entrypoint.sh"] ENTRYPOINT ["/entrypoint.sh"]
+122 -47
View File
@@ -1,77 +1,138 @@
# 🚀 Telegram for GitHub Actions # 🚀 Telegram for GitHub Actions
[GitHub Action](https://developer.github.com/actions/) for sending a Telegram notification message. [繁體中文](./README.zh-tw.md) | [简体中文](./README.zh-cn.md)
<img src="./images/telegram-notification.png"> [GitHub Action](https://github.com/features/actions) for sending Telegram notification messages.
![notification](./images/telegram-notification.png)
[![Actions Status](https://github.com/appleboy/telegram-action/workflows/telegram%20message/badge.svg)](https://github.com/appleboy/telegram-action/actions)
## Usage ## Usage
Send custom message as blow **Note**: If you receive the "Error: Chat not found" error, please refer to this StackOverflow answer [here](https://stackoverflow.com/a/41291666).
``` Send a custom message and view the custom variables below.
action "Send Custom Message" {
uses = "appleboy/telegram-action@master" ```yml
secrets = [ name: telegram message
"TELEGRAM_TOKEN", on: [push]
"TELEGRAM_TO", jobs:
]
args = "A new commit has been pushed." build:
} name: Build
runs-on: ubuntu-latest
steps:
- name: send telegram message on push
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
${{ 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.
``` ```yml
action "Send Default Message" { - name: send default message
uses = "appleboy/telegram-action@master" uses: appleboy/telegram-action@master
secrets = [ with:
"TELEGRAM_TOKEN", to: ${{ secrets.TELEGRAM_TO }}
"TELEGRAM_TO", token: ${{ secrets.TELEGRAM_TOKEN }}
]
}
``` ```
<img src="images/telegram-workflow.png"> ![workflow](./images/telegram-workflow.png)
## Environment variables ## Input variables
* PHOTO - Optional. photo message | Variable | Description |
* DOCUMENT - Optional. document message | ------------------------ | ----------------------------------------------------------------------------------------------------------------------- |
* STICKER - Optional. sticker message | socks5 | optional. Support socks5 proxy URL |
* AUDIO - Optional. audio message | photo | optional. Photo message |
* VOICE - Optional. voice message | document | optional. Document message |
* LOCATION - Optional. location message | sticker | optional. Sticker message |
* VENUE - Optional. venue message | audio | optional. Audio message |
* VIDEO - Optional. video message | voice | optional. Voice message |
* DEBUG - Optional. enable debug mode | location | optional. Location message |
| venue | optional. Venue message |
| video | optional. Video message |
| debug | optional. Enable debug mode |
| 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_thread_id | optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only. |
| 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
Send photo message:
```yml
- uses: actions/checkout@master
- 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
``` ```
action "Send photo message" {
uses = "appleboy/telegram-action@master" Send location message:
secrets = [
"TELEGRAM_TOKEN", ```yml
"TELEGRAM_TO", - name: send location message
] uses: appleboy/telegram-action@master
env = { with:
PHOTO = "tests/github.png" to: ${{ secrets.TELEGRAM_TO }}
} token: ${{ secrets.TELEGRAM_TOKEN }}
args = "A new commit has been pushed." location: '24.9163213 121.1424972'
} venue: '35.661777 139.704051 竹北體育館 新竹縣竹北市'
```
Send a message to a specific forum topic (thread):
```yml
- name: send message to forum topic
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message_thread_id: 42
message: Hello from GitHub Actions!
```
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 ## 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:
``` ```bash
$ curl https://api.telegram.org/bot<token>/getUpdates curl https://api.telegram.org/bot<token>/getUpdates
``` ```
See the result: (get chat id like `65382999`) See the result: (get chat id like `65382999`)
@@ -106,3 +167,17 @@ See the result: (get chat id like `65382999`)
] ]
} }
``` ```
## Template variable
| Github Variable | Telegram Template Variable |
| ----------------- | -------------------------- |
| GITHUB_REPOSITORY | repo |
| GITHUB_ACTOR | repo.namespace |
| GITHUB_SHA | commit.sha |
| GITHUB_REF | commit.ref |
| GITHUB_WORKFLOW | github.workflow |
| GITHUB_ACTION | github.action |
| GITHUB_EVENT_NAME | github.event.name |
| GITHUB_EVENT_PATH | github.event.path |
| GITHUB_WORKSPACE | github.workspace |
+133
View File
@@ -0,0 +1,133 @@
# 🚀 GitHub Actions 的 Telegram
[GitHub Action](https://github.com/features/actions) 用于发送 Telegram 通知消息。
![notification](./images/telegram-notification.png)
[![Actions Status](https://github.com/appleboy/telegram-action/workflows/telegram%20message/badge.svg)](https://github.com/appleboy/telegram-action/actions)
## 使用方法
**注意**:如果您收到 "Error: Chat not found" 错误,请参考这个 stackoverflow 的回答 [这里](https://stackoverflow.com/a/41291666)。
发送自定义消息并查看如下的自定义变量。
## 输入变量
| 变量 | 描述 |
| ------------------------ | ------------------------------------------------------------------------------------------------------- |
| socks5 | 可选。支持 socks5 代理 URL |
| photo | 可选。照片消息 |
| document | 可选。文档消息 |
| sticker | 可选。贴纸消息 |
| audio | 可选。音频消息 |
| voice | 可选。语音消息 |
| location | 可选。位置消息 |
| venue | 可选。场馆消息 |
| video | 可选。视频消息 |
| debug | 可选。启用调试模式 |
| format | 可选。`markdown``html`。参见 [MarkdownV2 样式](https://core.telegram.org/bots/api#markdownv2-style) |
| message | 可选。自定义消息 |
| message_file | 可选。用指定文件的内容覆盖默认消息模板。 |
| disable_web_page_preview | 可选。禁用此消息中链接的预览。默认值为 `false`。 |
| disable_notification | 可选。禁用此消息的通知,支持发送无通知的消息。默认值为 `false`。 |
## 示例
发送照片消息:
```yml
- uses: actions/checkout@master
- 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
```
发送位置消息:
```yml
- 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 竹北體育館 新竹縣竹北市'
```
使用自定义代理发送消息(支持 `http``https``socks5`),如 `socks5://127.0.0.1:1080``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
开始使用 [Telegram Bot API](https://core.telegram.org/bots/api)。
* `token`: Telegram 授权令牌。
* `to`: 此聊天的唯一标识符。
如何从 Telegram API 获取唯一标识符:
```bash
curl https://api.telegram.org/bot<token>/getUpdates
```
查看结果:(获取聊天 ID,如 `65382999`
```json
{
"ok": true,
"result": [
{
"update_id": 664568113,
"message": {
"message_id": 8423,
"from": {
"id": 65382999,
"is_bot": false,
"first_name": "Bo-Yi",
"last_name": "Wu (appleboy)",
"username": "appleboy46",
"language_code": "en"
},
"chat": {
"id": 65382999,
"first_name": "Bo-Yi",
"last_name": "Wu (appleboy)",
"username": "appleboy46",
"type": "private"
},
"date": 1550333434,
"text": "?"
}
}
]
}
```
## 模板变量
| GitHub 变量 | Telegram 模板变量 |
| ----------------- | ----------------- |
| GITHUB_REPOSITORY | repo |
| GITHUB_ACTOR | repo.namespace |
| GITHUB_SHA | commit.sha |
| GITHUB_REF | commit.ref |
| GITHUB_WORKFLOW | github.workflow |
| GITHUB_ACTION | github.action |
| GITHUB_EVENT_NAME | github.event.name |
| GITHUB_EVENT_PATH | github.event.path |
| GITHUB_WORKSPACE | github.workspace |
+133
View File
@@ -0,0 +1,133 @@
# 🚀 Telegram 的 GitHub Actions
透過 [GitHub Action](https://github.com/features/actions) 發送 Telegram 通知訊息。
![通知](./images/telegram-notification.png)
[![Actions 狀態](https://github.com/appleboy/telegram-action/workflows/telegram%20message/badge.svg)](https://github.com/appleboy/telegram-action/actions)
## 使用方式
**注意**:如果您收到 "Error: Chat not found" 錯誤,請參考此 stackoverflow 上的回答 [連結](https://stackoverflow.com/a/41291666)。
發送自訂訊息並參考以下自訂變數。
## 輸入變數
| 變數 | 說明 |
| ------------------------ | ------------------------------------------------------------------------------------------------------- |
| socks5 | 選填。支援 socks5 代理 URL |
| photo | 選填。圖片訊息 |
| document | 選填。文件訊息 |
| sticker | 選填。貼圖訊息 |
| audio | 選填。音訊訊息 |
| voice | 選填。語音訊息 |
| location | 選填。位置訊息 |
| venue | 選填。地點訊息 |
| video | 選填。影片訊息 |
| debug | 選填。啟用除錯模式 |
| format | 選填。`markdown``html`。參見 [MarkdownV2 格式](https://core.telegram.org/bots/api#markdownv2-style) |
| message | 選填。自訂訊息 |
| message_file | 選填。使用指定檔案的內容覆蓋預設訊息模板 |
| disable_web_page_preview | 選填。停用此訊息中連結的預覽。預設為 `false` |
| disable_notification | 選填。停用此訊息的通知,支援發送無通知的訊息。預設為 `false` |
## 範例
發送圖片訊息:
```yml
- uses: actions/checkout@master
- 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
```
發送位置消息:
```yml
- 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 竹北體育館 新竹縣竹北市'
```
使用自定義代理發送消息(支持 `http``https``socks5`),如 `socks5://127.0.0.1:1080``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
開始使用 [Telegram Bot API](https://core.telegram.org/bots/api)。
* `token`: Telegram 授權令牌。
* `to`: 此聊天的唯一標識符。
如何從 telegram api 獲取唯一標識符:
```bash
curl https://api.telegram.org/bot<token>/getUpdates
```
查看結果:(獲取聊天 ID,如 `65382999`
```json
{
"ok": true,
"result": [
{
"update_id": 664568113,
"message": {
"message_id": 8423,
"from": {
"id": 65382999,
"is_bot": false,
"first_name": "Bo-Yi",
"last_name": "Wu (appleboy)",
"username": "appleboy46",
"language_code": "en"
},
"chat": {
"id": 65382999,
"first_name": "Bo-Yi",
"last_name": "Wu (appleboy)",
"username": "appleboy46",
"type": "private"
},
"date": 1550333434,
"text": "?"
}
}
]
}
```
## 模板變數
| Github 變數 | Telegram 模板變數 |
| ----------------- | ----------------- |
| GITHUB_REPOSITORY | repo |
| GITHUB_ACTOR | repo.namespace |
| GITHUB_SHA | commit.sha |
| GITHUB_REF | commit.ref |
| GITHUB_WORKFLOW | github.workflow |
| GITHUB_ACTION | github.action |
| GITHUB_EVENT_NAME | github.event.name |
| GITHUB_EVENT_PATH | github.event.path |
| GITHUB_WORKSPACE | github.workspace |
+47
View File
@@ -0,0 +1,47 @@
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:
description: 'send the document message.'
sticker:
description: 'send the sticker message.'
audio:
description: 'send the audio message.'
voice:
description: 'send the voice message.'
location:
description: 'send the location message.'
venue:
description: 'send the venue message.'
video:
description: 'send the video message.'
debug:
description: 'enable debug mode.'
format:
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,'
message_thread_id:
description: 'unique identifier for the target message thread (topic) of the forum; for forum supergroups only'
runs:
using: 'docker'
image: 'Dockerfile'
branding:
icon: 'message-square'
color: 'blue'
+3
View File
@@ -0,0 +1,3 @@
Sample message loaded from file.
Commit msg: {{commit.message}}