From c159c0177f65ef55031b7265ad7a243623349fb4 Mon Sep 17 00:00:00 2001 From: vbevdev Date: Sat, 4 Jul 2026 01:27:59 +0300 Subject: [PATCH] deploy-workflow: create docker compose file --- .../telegram-message-escape/action.yaml | 21 ++++++++++++++----- .gitea/workflows/deploy.yaml | 4 ++-- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.gitea/actions/telegram-message-escape/action.yaml b/.gitea/actions/telegram-message-escape/action.yaml index 89d80a8..9fe0d01 100644 --- a/.gitea/actions/telegram-message-escape/action.yaml +++ b/.gitea/actions/telegram-message-escape/action.yaml @@ -15,12 +15,23 @@ runs: using: 'composite' steps: - id: escape - shell: bash + shell: python env: RAW_MESSAGE: ${{ inputs.message }} + ESCAPED_MESSAGE: ${{ github.output }} run: | - ESCAPED_MESSAGE=$(echo "$RAW_MESSAGE" | sed "s|-|-\\\\-|g" | sed "s|\.|\ \ \ \ .|g" | sed "s|!|\\\\!|g") + import os + + raw_text = os.environ.get("RAW_MESSAGE", "") + output_file = os.environ.get("ESCAPED_MESSAGE") + + escape_chars = ["-", ".", "!"] - echo "result<> $GITHUB_OUTPUT - echo "$ESCAPED_MESSAGE" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT + escaped_text = raw_text + for char in escape_chars: + escaped_text = escaped_text.replace(char, f"\\{char}") + + with open(output_file, "a", encoding="utf-8") as f: + f.write("result<