6 Commits

Author SHA1 Message Date
Bo-Yi Wu 11eac4982b fix: author homepage. 2019-02-17 16:58:22 +08:00
Bo-Yi Wu e8ea5ee34f chore: update base docker image. 2019-02-17 16:56:39 +08:00
Bo-Yi Wu 2eee0c6ce3 docs: update 2019-02-17 16:33:00 +08:00
Bo-Yi Wu bd236a6c5a fix: check empty 2019-02-17 16:28:51 +08:00
Bo-Yi Wu a155de7800 fix: enable GitHub env 2019-02-17 16:14:00 +08:00
Bo-Yi Wu 4025d6255a feat: support default message 2019-02-17 16:10:25 +08:00
5 changed files with 38 additions and 15 deletions
+13 -2
View File
@@ -1,9 +1,12 @@
workflow "Send Notification" { workflow "Send Notification" {
on = "push" on = "push"
resolves = ["Post message to Telegram"] resolves = [
"Send Custom Message",
"Send Default Message"
]
} }
action "Post message to Telegram" { action "Send Custom Message" {
uses = "appleboy/telegram-action@master" uses = "appleboy/telegram-action@master"
secrets = [ secrets = [
"TELEGRAM_TOKEN", "TELEGRAM_TOKEN",
@@ -11,3 +14,11 @@ action "Post message to Telegram" {
] ]
args = "A new commit has been pushed." args = "A new commit has been pushed."
} }
action "Send Default Message" {
uses = "appleboy/telegram-action@master"
secrets = [
"TELEGRAM_TOKEN",
"TELEGRAM_TO",
]
}
+5 -11
View File
@@ -1,21 +1,15 @@
FROM golang:1.11 FROM appleboy/drone-telegram:1.4.1-linux-amd64
# Github labels # Github labels
LABEL "com.github.actions.name"="Telegram Notify" LABEL "com.github.actions.name"="Telegram Notify"
LABEL "com.github.actions.description"="Sending a Telegram notification message" LABEL "com.github.actions.description"="Sending a Telegram message"
LABEL "com.github.actions.icon"="message-square" LABEL "com.github.actions.icon"="message-square"
LABEL "com.github.actions.color"="blue" LABEL "com.github.actions.color"="blue"
LABEL "repository"="https://github.com/Ilshidur/actions" LABEL "repository"="https://github.com/appleboy/telegram-action"
LABEL "homepage"="https://github.com/appleboy/telegram-action" LABEL "homepage"="https://github.com/appleboy"
LABEL "maintainer"="Bo-Yi Wu <appleboy.tw@gmail.com>" LABEL "maintainer"="Bo-Yi Wu <appleboy.tw@gmail.com>"
LABEL "version"="0.0.1" LABEL "version"="0.0.2"
ENV TELEGRAM_VERSION=1.4.0
ENV OS_ARCH=linux-amd64
RUN wget https://github.com/appleboy/drone-telegram/releases/download/${TELEGRAM_VERSION}/drone-telegram-${TELEGRAM_VERSION}-${OS_ARCH} -O /bin/drone-telegram
RUN chmod +x /bin/drone-telegram
ADD entrypoint.sh /entrypoint.sh ADD entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh RUN chmod +x /entrypoint.sh
+17 -1
View File
@@ -6,8 +6,10 @@
## Usage ## Usage
Send custom message as blow
``` ```
action "Post message to Telegram" { action "Send Custom Message" {
uses = "appleboy/telegram-action@master" uses = "appleboy/telegram-action@master"
secrets = [ secrets = [
"TELEGRAM_TOKEN", "TELEGRAM_TOKEN",
@@ -17,6 +19,20 @@ action "Post message to Telegram" {
} }
``` ```
Send the default message. Please remove args
```
action "Send Default Message" {
uses = "appleboy/telegram-action@master"
secrets = [
"TELEGRAM_TOKEN",
"TELEGRAM_TO",
]
}
```
<img src="images/telegram-workflow.png">
## 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).
+3 -1
View File
@@ -2,6 +2,8 @@
set -eu set -eu
export TELEGRAM_MESSAGE="$*" export GITHUB="true"
[ -n "$*" ] && export TELEGRAM_MESSAGE="$*"
/bin/drone-telegram /bin/drone-telegram
Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB