Skip to content

Commit

Permalink
chore: support disable web page preview (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
appleboy authored Oct 3, 2020
1 parent 0e7bbc5 commit 9e5e0be
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
26 changes: 22 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,30 @@ jobs:
# token: ${{ secrets.TELEGRAM_TOKEN }}
# socks5: "http://222.124.154.19:23500"
# message: Send message from socks5 proxy URL.
- name: try multiple message

# - 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: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
link preview https://google.com.tw
- name: disable link preview
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
format: html
webpage_preview: false
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 }}
link preview https://google.com.tw
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Remove `args` to send the default message.
* 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.
* webpage_preview - optional. disables link previews for links in this message. default is `true`.

## Example

Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ inputs:
description: 'enable debug mode.'
format:
description: 'message format: markdown or html'
webpage_preview:
description: 'disables link previews for links in this message'
default: true
runs:
using: 'docker'
image: 'Dockerfile'
Expand Down

0 comments on commit 9e5e0be

Please sign in to comment.