mirror of
https://github.com/appleboy/telegram-action.git
synced 2026-10-07 03:30:44 +09:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dd9f2d9fa7 | ||
|
|
4023d256c8 | ||
|
|
214f06cfa3 | ||
|
|
2608c6db39 | ||
|
|
c078210187 | ||
|
|
7f612b977e | ||
|
|
c18c95644a | ||
|
|
6753faf1d2 | ||
|
|
53d62f6c74 | ||
|
|
e9e9d8fda7 | ||
|
|
16657635b3 | ||
|
|
fd541f19b0 | ||
|
|
f8121d9e5a | ||
|
|
b8da483c2e | ||
|
|
724a55ccf8 | ||
|
|
8223320a4c | ||
|
|
ea12760348 | ||
|
|
d678193671 |
@@ -0,0 +1,15 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
|
commit-message:
|
||||||
|
prefix: "chore(ci)"
|
||||||
|
|
||||||
|
- package-ecosystem: "docker"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
|
commit-message:
|
||||||
|
prefix: "chore(docker)"
|
||||||
@@ -1,18 +1,34 @@
|
|||||||
name: telegram message
|
name: telegram message
|
||||||
on: [push]
|
on: [push]
|
||||||
jobs:
|
jobs:
|
||||||
|
# Tests the working-tree Dockerfile and entrypoint.sh; the build job below
|
||||||
|
# runs against the published image referenced by action.yml instead.
|
||||||
|
local-image:
|
||||||
|
name: Test local image build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
|
||||||
|
- name: build image from working tree
|
||||||
|
run: docker build -t telegram-action:local .
|
||||||
|
|
||||||
|
- name: send message via local image
|
||||||
|
env:
|
||||||
|
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
|
||||||
|
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
|
run: |
|
||||||
|
docker run --rm \
|
||||||
|
-e INPUT_TO="$TELEGRAM_TO" \
|
||||||
|
-e INPUT_TOKEN="$TELEGRAM_TOKEN" \
|
||||||
|
-e INPUT_MESSAGE_THREAD_ID= \
|
||||||
|
-e INPUT_MESSAGE="ci: local image smoke test for ${{ github.sha }}" \
|
||||||
|
telegram-action:local
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v7
|
||||||
- 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
|
- name: send message using with
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -0,0 +1,59 @@
|
|||||||
|
name: Docker Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
tags:
|
||||||
|
# full semver only; the floating major tag (v1) must not trigger builds
|
||||||
|
- "v[0-9]*.[0-9]*.[0-9]*"
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-docker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v7
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v4
|
||||||
|
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
uses: docker/login-action@v4
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Docker meta
|
||||||
|
id: docker-meta
|
||||||
|
uses: docker/metadata-action@v6
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
ghcr.io/${{ github.repository }}
|
||||||
|
tags: |
|
||||||
|
type=raw,value=latest,enable={{is_default_branch}}
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
|
type=semver,pattern={{major}}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v7
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
tags: ${{ steps.docker-meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.docker-meta.outputs.labels }}
|
||||||
@@ -3,7 +3,8 @@ name: Goreleaser
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- "*"
|
# full semver only; the floating major tag (v1) must not cut a release
|
||||||
|
- "v[0-9]*.[0-9]*.[0-9]*"
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
@@ -17,11 +18,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup go
|
|
||||||
uses: actions/setup-go@v7
|
|
||||||
with:
|
|
||||||
go-version: "^1"
|
|
||||||
|
|
||||||
- name: Run GoReleaser
|
- name: Run GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@v7
|
uses: goreleaser/goreleaser-action@v7
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
.DS_Store
|
||||||
+1
-2
@@ -1,7 +1,6 @@
|
|||||||
FROM ghcr.io/appleboy/drone-telegram:1.4.2
|
FROM ghcr.io/appleboy/drone-telegram:1.5.1
|
||||||
|
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
RUN chmod +x /entrypoint.sh
|
|
||||||
|
|
||||||
WORKDIR /github/workspace
|
WORKDIR /github/workspace
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: send telegram message on push
|
- name: send telegram message on push
|
||||||
uses: appleboy/telegram-action@master
|
uses: appleboy/telegram-action@v1
|
||||||
with:
|
with:
|
||||||
to: ${{ secrets.TELEGRAM_TO }}
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
@@ -37,11 +37,11 @@ jobs:
|
|||||||
See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}}
|
See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}}
|
||||||
```
|
```
|
||||||
|
|
||||||
Remove `args` to send the default message.
|
Remove the `message` input to send the default message.
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
- name: send default message
|
- name: send default message
|
||||||
uses: appleboy/telegram-action@master
|
uses: appleboy/telegram-action@v1
|
||||||
with:
|
with:
|
||||||
to: ${{ secrets.TELEGRAM_TO }}
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
@@ -53,6 +53,8 @@ Remove `args` to send the default message.
|
|||||||
|
|
||||||
| Variable | Description |
|
| Variable | Description |
|
||||||
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------- |
|
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| to | **required**. Unique identifier for the target chat. |
|
||||||
|
| token | **required**. Telegram authorization token. |
|
||||||
| socks5 | optional. Support socks5 proxy URL |
|
| socks5 | optional. Support socks5 proxy URL |
|
||||||
| photo | optional. Photo message |
|
| photo | optional. Photo message |
|
||||||
| document | optional. Document message |
|
| document | optional. Document message |
|
||||||
@@ -75,9 +77,9 @@ Remove `args` to send the default message.
|
|||||||
Send photo message:
|
Send photo message:
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@v7
|
||||||
- name: send photo message
|
- name: send photo message
|
||||||
uses: appleboy/telegram-action@master
|
uses: appleboy/telegram-action@v1
|
||||||
with:
|
with:
|
||||||
to: ${{ secrets.TELEGRAM_TO }}
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
@@ -90,7 +92,7 @@ Send location message:
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
- name: send location message
|
- name: send location message
|
||||||
uses: appleboy/telegram-action@master
|
uses: appleboy/telegram-action@v1
|
||||||
with:
|
with:
|
||||||
to: ${{ secrets.TELEGRAM_TO }}
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
@@ -102,7 +104,7 @@ Send a message to a specific forum topic (thread):
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
- name: send message to forum topic
|
- name: send message to forum topic
|
||||||
uses: appleboy/telegram-action@master
|
uses: appleboy/telegram-action@v1
|
||||||
with:
|
with:
|
||||||
to: ${{ secrets.TELEGRAM_TO }}
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
@@ -114,7 +116,7 @@ Send message using custom proxy (support `http`, `https`, and `socks5`) like `so
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
- name: send message using socks5 proxy URL
|
- name: send message using socks5 proxy URL
|
||||||
uses: appleboy/telegram-action@master
|
uses: appleboy/telegram-action@v1
|
||||||
with:
|
with:
|
||||||
to: ${{ secrets.TELEGRAM_TO }}
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
|
|||||||
+7
-4
@@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
| 变量 | 描述 |
|
| 变量 | 描述 |
|
||||||
| ------------------------ | ------------------------------------------------------------------------------------------------------- |
|
| ------------------------ | ------------------------------------------------------------------------------------------------------- |
|
||||||
|
| to | **必填**。目标聊天的唯一标识符 |
|
||||||
|
| token | **必填**。Telegram 授权令牌 |
|
||||||
| socks5 | 可选。支持 socks5 代理 URL |
|
| socks5 | 可选。支持 socks5 代理 URL |
|
||||||
| photo | 可选。照片消息 |
|
| photo | 可选。照片消息 |
|
||||||
| document | 可选。文档消息 |
|
| document | 可选。文档消息 |
|
||||||
@@ -29,6 +31,7 @@
|
|||||||
| format | 可选。`markdown` 或 `html`。参见 [MarkdownV2 样式](https://core.telegram.org/bots/api#markdownv2-style) |
|
| format | 可选。`markdown` 或 `html`。参见 [MarkdownV2 样式](https://core.telegram.org/bots/api#markdownv2-style) |
|
||||||
| message | 可选。自定义消息 |
|
| message | 可选。自定义消息 |
|
||||||
| message_file | 可选。用指定文件的内容覆盖默认消息模板。 |
|
| message_file | 可选。用指定文件的内容覆盖默认消息模板。 |
|
||||||
|
| message_thread_id | 可选。论坛目标消息串(主题)的唯一标识符,仅适用于论坛超级群组。 |
|
||||||
| disable_web_page_preview | 可选。禁用此消息中链接的预览。默认值为 `false`。 |
|
| disable_web_page_preview | 可选。禁用此消息中链接的预览。默认值为 `false`。 |
|
||||||
| disable_notification | 可选。禁用此消息的通知,支持发送无通知的消息。默认值为 `false`。 |
|
| disable_notification | 可选。禁用此消息的通知,支持发送无通知的消息。默认值为 `false`。 |
|
||||||
|
|
||||||
@@ -37,9 +40,9 @@
|
|||||||
发送照片消息:
|
发送照片消息:
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@v7
|
||||||
- name: send photo message
|
- name: send photo message
|
||||||
uses: appleboy/telegram-action@master
|
uses: appleboy/telegram-action@v1
|
||||||
with:
|
with:
|
||||||
to: ${{ secrets.TELEGRAM_TO }}
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
@@ -52,7 +55,7 @@
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
- name: send location message
|
- name: send location message
|
||||||
uses: appleboy/telegram-action@master
|
uses: appleboy/telegram-action@v1
|
||||||
with:
|
with:
|
||||||
to: ${{ secrets.TELEGRAM_TO }}
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
@@ -64,7 +67,7 @@
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
- name: send message using socks5 proxy URL
|
- name: send message using socks5 proxy URL
|
||||||
uses: appleboy/telegram-action@master
|
uses: appleboy/telegram-action@v1
|
||||||
with:
|
with:
|
||||||
to: ${{ secrets.TELEGRAM_TO }}
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
|
|||||||
+7
-4
@@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
| 變數 | 說明 |
|
| 變數 | 說明 |
|
||||||
| ------------------------ | ------------------------------------------------------------------------------------------------------- |
|
| ------------------------ | ------------------------------------------------------------------------------------------------------- |
|
||||||
|
| to | **必填**。目標聊天的唯一標識符 |
|
||||||
|
| token | **必填**。Telegram 授權令牌 |
|
||||||
| socks5 | 選填。支援 socks5 代理 URL |
|
| socks5 | 選填。支援 socks5 代理 URL |
|
||||||
| photo | 選填。圖片訊息 |
|
| photo | 選填。圖片訊息 |
|
||||||
| document | 選填。文件訊息 |
|
| document | 選填。文件訊息 |
|
||||||
@@ -29,6 +31,7 @@
|
|||||||
| format | 選填。`markdown` 或 `html`。參見 [MarkdownV2 格式](https://core.telegram.org/bots/api#markdownv2-style) |
|
| format | 選填。`markdown` 或 `html`。參見 [MarkdownV2 格式](https://core.telegram.org/bots/api#markdownv2-style) |
|
||||||
| message | 選填。自訂訊息 |
|
| message | 選填。自訂訊息 |
|
||||||
| message_file | 選填。使用指定檔案的內容覆蓋預設訊息模板 |
|
| message_file | 選填。使用指定檔案的內容覆蓋預設訊息模板 |
|
||||||
|
| message_thread_id | 選填。論壇目標訊息串(主題)的唯一標識符,僅適用於論壇超級群組 |
|
||||||
| disable_web_page_preview | 選填。停用此訊息中連結的預覽。預設為 `false` |
|
| disable_web_page_preview | 選填。停用此訊息中連結的預覽。預設為 `false` |
|
||||||
| disable_notification | 選填。停用此訊息的通知,支援發送無通知的訊息。預設為 `false` |
|
| disable_notification | 選填。停用此訊息的通知,支援發送無通知的訊息。預設為 `false` |
|
||||||
|
|
||||||
@@ -37,9 +40,9 @@
|
|||||||
發送圖片訊息:
|
發送圖片訊息:
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@v7
|
||||||
- name: send photo message
|
- name: send photo message
|
||||||
uses: appleboy/telegram-action@master
|
uses: appleboy/telegram-action@v1
|
||||||
with:
|
with:
|
||||||
to: ${{ secrets.TELEGRAM_TO }}
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
@@ -52,7 +55,7 @@
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
- name: send location message
|
- name: send location message
|
||||||
uses: appleboy/telegram-action@master
|
uses: appleboy/telegram-action@v1
|
||||||
with:
|
with:
|
||||||
to: ${{ secrets.TELEGRAM_TO }}
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
@@ -64,7 +67,7 @@
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
- name: send message using socks5 proxy URL
|
- name: send message using socks5 proxy URL
|
||||||
uses: appleboy/telegram-action@master
|
uses: appleboy/telegram-action@v1
|
||||||
with:
|
with:
|
||||||
to: ${{ secrets.TELEGRAM_TO }}
|
to: ${{ secrets.TELEGRAM_TO }}
|
||||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
|
|||||||
+3
-1
@@ -4,8 +4,10 @@ author: 'Bo-Yi Wu'
|
|||||||
inputs:
|
inputs:
|
||||||
to:
|
to:
|
||||||
description: 'telegram user'
|
description: 'telegram user'
|
||||||
|
required: true
|
||||||
token:
|
token:
|
||||||
description: 'telegram token'
|
description: 'telegram token'
|
||||||
|
required: true
|
||||||
message:
|
message:
|
||||||
description: 'telegram message'
|
description: 'telegram message'
|
||||||
message_file:
|
message_file:
|
||||||
@@ -40,7 +42,7 @@ inputs:
|
|||||||
description: 'unique identifier for the target message thread (topic) of the forum; for forum supergroups only'
|
description: 'unique identifier for the target message thread (topic) of the forum; for forum supergroups only'
|
||||||
runs:
|
runs:
|
||||||
using: 'docker'
|
using: 'docker'
|
||||||
image: 'Dockerfile'
|
image: 'docker://ghcr.io/appleboy/telegram-action:1.1.1'
|
||||||
|
|
||||||
branding:
|
branding:
|
||||||
icon: 'message-square'
|
icon: 'message-square'
|
||||||
|
|||||||
@@ -4,6 +4,4 @@ set -eu
|
|||||||
|
|
||||||
export GITHUB="true"
|
export GITHUB="true"
|
||||||
|
|
||||||
[ -n "$*" ] && export TELEGRAM_MESSAGE="$*"
|
|
||||||
|
|
||||||
/bin/drone-telegram
|
/bin/drone-telegram
|
||||||
|
|||||||
Reference in New Issue
Block a user