From 15cafea367a1a1c02aa9654fdbdd559472f18460 Mon Sep 17 00:00:00 2001 From: vbevdev Date: Sat, 4 Jul 2026 01:56:26 +0300 Subject: [PATCH] deploy-workflow: create docker compose file --- .../telegram-message-escape/action.yaml | 36 +++++-------------- 1 file changed, 9 insertions(+), 27 deletions(-) diff --git a/.gitea/actions/telegram-message-escape/action.yaml b/.gitea/actions/telegram-message-escape/action.yaml index 8eda048..a5bc84e 100644 --- a/.gitea/actions/telegram-message-escape/action.yaml +++ b/.gitea/actions/telegram-message-escape/action.yaml @@ -15,34 +15,16 @@ runs: using: 'composite' steps: - id: escape - shell: python + shell: bash env: RAW_MESSAGE: ${{ inputs.message }} - ESCAPED_MESSAGE: $GITHUB_OUTPUT run: | - import os + MSG="$RAW_MESSAGE" + MSG="${MSG//-/\\-}" + MSG="${MSG//./\\.}" + MSG="${MSG//!/\\!}" + MSG="${MSG//\`/\\\\\\\`}" - raw_text = os.environ.get("RAW_MESSAGE", "") - output_file = os.environ.get("ESCAPED_MESSAGE") - - def escape_text(text): - escape_chars = ["-", ".", "!"] - for char in escape_chars: - text = text.replace(char, f"\\{char}") - return text - - parts = raw_text.split("`") - processed_parts = [] - - for i, part in enumerate(parts): - if i % 2 == 0: - processed_parts.append(escape_text(part)) - else: - processed_parts.append(f"\\`{part}\\`") - - escaped_text = "".join(processed_parts) - - with open(output_file, "a", encoding="utf-8") as f: - f.write("result<> $GITHUB_OUTPUT + echo "$MSG" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT