30 Commits

Author SHA1 Message Date
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
6 changed files with 183 additions and 80 deletions
+96 -55
View File
@@ -1,69 +1,110 @@
name: telegram message
on: [push]
jobs:
build:
name: Build
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.
- uses: actions/checkout@master
- 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 useing with
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: The ${{ github.event_name }} event triggered second 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: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
- name: send default message
uses: ./
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'
- 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: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
location: '24.9163213 121.1424972'
venue: '35.661777 139.704051 竹北體育館 新竹縣竹北市'
- 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: 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.
- 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: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message_file: tests/message.txt
- 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: 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@v4
with:
fetch-depth: 0
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: "^1"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
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
+2 -2
View File
@@ -1,6 +1,6 @@
FROM appleboy/drone-telegram:1.3.5-linux-amd64
FROM ghcr.io/appleboy/drone-telegram:1.4.0
ADD entrypoint.sh /entrypoint.sh
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
WORKDIR /github/workspace
+20 -23
View File
@@ -8,7 +8,9 @@
## 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
name: telegram message
@@ -19,13 +21,18 @@ jobs:
name: Build
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.
- 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.
@@ -52,8 +59,11 @@ Remove `args` to send the default message.
* venue - optional. venue message
* video - optional. video message
* 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.
* 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
@@ -83,20 +93,7 @@ send location message:
venue: '35.661777 139.704051 竹北體育館 新竹縣竹北市'
```
send custom message:
```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`)
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
+4
View File
@@ -32,6 +32,10 @@ inputs:
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,'
runs:
using: 'docker'
image: 'Dockerfile'