mirror of
https://github.com/groldsf/obsidian_check_plugin.git
synced 2026-07-22 05:37:48 +00:00
Update tg_notify.yml
This commit is contained in:
parent
da1168d343
commit
4f70f30987
1 changed files with 28 additions and 10 deletions
38
.github/workflows/tg_notify.yml
vendored
38
.github/workflows/tg_notify.yml
vendored
|
|
@ -11,19 +11,37 @@ on:
|
|||
types: [submitted]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
notify:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: send telegram message on push
|
||||
- name: Create message file
|
||||
run: |
|
||||
TITLE="${{ github.event.issue.title || github.event.pull_request.title || 'Комментарий' }}"
|
||||
COMMENT="${{ github.event.comment.body || '' }}"
|
||||
MSG="Repository: ${{ github.repository }}
|
||||
Type: ${{ github.event_name }}
|
||||
Action: ${{ github.event.action }}
|
||||
Title: ${TITLE}
|
||||
${COMMENT}
|
||||
|
||||
See: ${{ github.event.issue.html_url || github.event.pull_request.html_url || github.event.comment.html_url || github.event.review.html_url }}"
|
||||
echo "$MSG" > message.txt
|
||||
LENGTH=$(wc -c < message.txt)
|
||||
echo "MESSAGE_LENGTH=$LENGTH" >> $GITHUB_ENV
|
||||
|
||||
- name: Send full message if short
|
||||
if: ${{ env.MESSAGE_LENGTH < 4096 }}
|
||||
uses: appleboy/telegram-action@master
|
||||
with:
|
||||
to: ${{ secrets.TELEGRAM_CHAT_ID }}
|
||||
token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
|
||||
message: |
|
||||
Repository: ${{ github.repository }}
|
||||
Type: ${{ github.event_name }}
|
||||
Action: ${{ github.event.action }}
|
||||
Titile: ${{ github.event.issue.title || github.event.pull_request.title || 'Комментарий' }}
|
||||
${{github.event.comment.body || ''}}
|
||||
See ${{ github.event.issue.html_url || github.event.pull_request.html_url || github.event.comment.html_url || github.event.review.html_url }}
|
||||
message_file: message.txt
|
||||
|
||||
- name: Send only link if message too long
|
||||
if: ${{ env.MESSAGE_LENGTH >= 4096 }}
|
||||
uses: appleboy/telegram-action@master
|
||||
with:
|
||||
to: ${{ secrets.TELEGRAM_CHAT_ID }}
|
||||
token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
|
||||
message: |
|
||||
See: ${{ github.event.issue.html_url || github.event.pull_request.html_url || github.event.comment.html_url || github.event.review.html_url }}
|
||||
|
|
|
|||
Loading…
Reference in a new issue