From 23e52e6cd64b0192430d1db59a18fc292f80d0b3 Mon Sep 17 00:00:00 2001 From: Grol Grol Date: Thu, 13 Mar 2025 21:29:47 +0300 Subject: [PATCH] aaaaaaaaaa --- .github/workflows/tg_notify.yml | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/.github/workflows/tg_notify.yml b/.github/workflows/tg_notify.yml index 07026ce..e99ce10 100644 --- a/.github/workflows/tg_notify.yml +++ b/.github/workflows/tg_notify.yml @@ -19,30 +19,9 @@ jobs: TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} run: | - REPO="${{ github.repository }}" - EVENT_TYPE="${{ github.event_name }}" - ACTION="${{ github.event.action }}" - TITLE="${{ github.event.issue.title || github.event.pull_request.title || 'Комментарий' }}" - URL="${{ github.event.issue.html_url || github.event.pull_request.html_url || github.event.comment.html_url || github.event.review.html_url }}" - - escape_markdown_v2() { - echo "$1" | sed -e 's/[_*\[\]()~`>#+\-=|{}.!]/\\&/g' - } - - SAFE_REPO=$(escape_markdown_v2 "$REPO") - SAFE_EVENT=$(escape_markdown_v2 "$EVENT_TYPE") - SAFE_ACTION=$(escape_markdown_v2 "$ACTION") - SAFE_TITLE=$(escape_markdown_v2 "$TITLE") - SAFE_URL=$(escape_markdown_v2 "$URL") - - TEXT="*Событие в ${SAFE_REPO}* -Тип: \`${SAFE_EVENT}\` -Действие: \`${SAFE_ACTION}\` -Заголовок: \`${SAFE_TITLE}\` -[Открыть](${SAFE_URL})" - + MESSAGE="Событие в *${{ github.repository }}*:\nТип: ${{ github.event_name }}\nДействие: ${{ github.event.action }}\nЗаголовок: ${{ github.event.issue.title || github.event.pull_request.title || 'Комментарий' }}\n[Открыть](${{ github.event.issue.html_url || github.event.pull_request.html_url || github.event.comment.html_url || github.event.review.html_url }})" curl -s -X POST \ https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage \ - -d chat_id="${TELEGRAM_CHAT_ID}" \ - -d parse_mode=MarkdownV2 \ - -d text="${TEXT}" + -d chat_id=${TELEGRAM_CHAT_ID} \ + -d parse_mode=Markdown \ + -d "text=${MESSAGE}" \ No newline at end of file