11 Commits

Author SHA1 Message Date
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
5 changed files with 53 additions and 29 deletions
+21 -19
View File
@@ -6,54 +6,56 @@ jobs:
name: Build name: Build
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@master
- name: send custom message with args - name: send custom message with args
uses: appleboy/telegram-action@master uses: appleboy/telegram-action@master
env:
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
with: with:
to: ${{ secrets.TELEGRAM_TO }}
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 useing with
uses: appleboy/telegram-action@master uses: appleboy/telegram-action@master
env:
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
with: with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: The ${{ github.event_name }} event triggered second step. message: The ${{ github.event_name }} event triggered second step.
- name: send default message - name: send default message
uses: appleboy/telegram-action@master uses: appleboy/telegram-action@master
env: with:
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} to: ${{ secrets.TELEGRAM_TO }}
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }} token: ${{ secrets.TELEGRAM_TOKEN }}
- name: send photo message - name: send photo message
uses: appleboy/telegram-action@master uses: appleboy/telegram-action@master
with: with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: send photo message message: send photo message
photo: './tests/github.png' photo: './tests/github.png'
document: './tests/gophercolor.png' document: './tests/gophercolor.png'
env:
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
- name: send location message - name: send location message
uses: appleboy/telegram-action@master uses: appleboy/telegram-action@master
with: with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
location: '24.9163213 121.1424972' location: '24.9163213 121.1424972'
venue: '35.661777 139.704051 竹北體育館 新竹縣竹北市' venue: '35.661777 139.704051 竹北體育館 新竹縣竹北市'
env:
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
- name: send custom message - name: send custom message
uses: appleboy/telegram-action@master uses: appleboy/telegram-action@master
env:
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }}
with: with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: | message: |
The ${{ github.event_name }} event triggered final step. The ${{ github.event_name }} event triggered final step.
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
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message_file: tests/message.txt
+1 -1
View File
@@ -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 ADD entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh RUN chmod +x /entrypoint.sh
+20 -9
View File
@@ -1,23 +1,32 @@
# 🚀 Telegram for GitHub Actions # 🚀 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.
![notification](./images/telegram-notification.png) ![notification](./images/telegram-notification.png)
[![Actions Status](https://github.com/appleboy/facebook-telegram/workflows/telegram%20message/badge.svg)](https://github.com/appleboy/facebook-action/actions) [![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 and see the custom variable as blow. Send custom message and see the custom variable as blow.
```yml ```yml
- name: send custom message name: telegram message
uses: appleboy/telegram-action@master on: [push]
env: jobs:
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }} build:
with: name: Build
args: The ${{ github.event_name }} event triggered first step. 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. Remove `args` to send the default message.
@@ -44,12 +53,14 @@ Remove `args` to send the default 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`
* message_file - optional. overwrite the default message template with the contents of the specified file.
### Example ### Example
send photo message: send photo message:
```yml ```yml
- uses: actions/checkout@master
- name: send photo message - name: send photo message
uses: appleboy/telegram-action@master uses: appleboy/telegram-action@master
with: with:
+8
View File
@@ -2,6 +2,14 @@ name: 'Telegram Message Notify'
description: 'Sending a Telegram message' description: 'Sending a Telegram message'
author: 'Bo-Yi Wu' author: 'Bo-Yi Wu'
inputs: 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: photo:
description: 'send the photo message.' description: 'send the photo message.'
document: document:
+3
View File
@@ -0,0 +1,3 @@
Sample message loaded from file.
Commit msg: {{commit.message}}