mirror of
https://github.com/appleboy/telegram-action.git
synced 2026-05-14 02:42:44 +00:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 65a4c9fc42 | |||
| ee6f548104 | |||
| 62444e6582 | |||
| 406cbeb82a | |||
| a5e94a4245 | |||
| 40cbdc99a4 | |||
| ac4245365c | |||
| 06cc7371ce | |||
| b535a89bc8 | |||
| 696643cdf6 | |||
| bd65e6f3ea |
+21
-19
@@ -6,54 +6,56 @@ jobs:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@master
|
||||
- name: send custom message with args
|
||||
uses: appleboy/telegram-action@master
|
||||
env:
|
||||
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
|
||||
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
|
||||
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
|
||||
env:
|
||||
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
|
||||
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
|
||||
with:
|
||||
to: ${{ secrets.TELEGRAM_TO }}
|
||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||
message: The ${{ github.event_name }} event triggered second step.
|
||||
|
||||
- name: send default message
|
||||
uses: appleboy/telegram-action@master
|
||||
env:
|
||||
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
|
||||
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
|
||||
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'
|
||||
env:
|
||||
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
|
||||
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
|
||||
|
||||
- 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 竹北體育館 新竹縣竹北市'
|
||||
env:
|
||||
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
|
||||
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
|
||||
|
||||
- name: send custom message
|
||||
uses: appleboy/telegram-action@master
|
||||
env:
|
||||
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
|
||||
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
|
||||
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
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
FROM appleboy/drone-telegram:1.3.1-linux-amd64
|
||||
FROM appleboy/drone-telegram:1.3.4-linux-amd64
|
||||
|
||||
ADD entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
@@ -1,23 +1,32 @@
|
||||
# 🚀 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
|
||||
|
||||
Send custom message and see the custom variable as blow.
|
||||
|
||||
```yml
|
||||
- name: send custom message
|
||||
uses: appleboy/telegram-action@master
|
||||
env:
|
||||
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
|
||||
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
|
||||
with:
|
||||
args: The ${{ github.event_name }} event triggered first step.
|
||||
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
|
||||
env:
|
||||
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
|
||||
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
|
||||
with:
|
||||
args: The ${{ github.event_name }} event triggered first step.
|
||||
```
|
||||
|
||||
Remove `args` to send the default message.
|
||||
@@ -44,12 +53,14 @@ Remove `args` to send the default message.
|
||||
* video - optional. video message
|
||||
* debug - optional. enable debug mode
|
||||
* format - optional. `markdown` or `html`
|
||||
* message_file - optional. overwrite the default message template with the contents of the specified file.
|
||||
|
||||
### Example
|
||||
|
||||
send photo message:
|
||||
|
||||
```yml
|
||||
- uses: actions/checkout@master
|
||||
- name: send photo message
|
||||
uses: appleboy/telegram-action@master
|
||||
with:
|
||||
|
||||
@@ -2,6 +2,14 @@ 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'
|
||||
photo:
|
||||
description: 'send the photo message.'
|
||||
document:
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
Sample message loaded from file.
|
||||
|
||||
Commit msg: {{commit.message}}
|
||||
Reference in New Issue
Block a user