From e755f3800eba538bbdcc369bb491f87563438a16 Mon Sep 17 00:00:00 2001 From: Amirhossein Alibakhshi Date: Tue, 6 May 2025 18:59:28 +0330 Subject: [PATCH] Update announcement.yml --- .github/workflows/announcement.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/announcement.yml b/.github/workflows/announcement.yml index bb36d88..067cd7e 100644 --- a/.github/workflows/announcement.yml +++ b/.github/workflows/announcement.yml @@ -11,19 +11,18 @@ jobs: runs-on: ubuntu-latest steps: - - name: Extract Release Notes + - name: Extract and sanitize release notes id: extract run: | - # Save PR body to file echo "${{ github.event.pull_request.body }}" > pr_body.md - - # Extract everything from "# Releases" onward + + # Extract lines from "# Releases" onward awk '/^# Releases/ {found=1} found' pr_body.md > release_notes.txt - # Escape backticks to keep Telegram Markdown happy - sed 's/`/\\`/g' release_notes.txt > sanitized_notes.txt + # Escape characters for Telegram MarkdownV2 + sed -e 's/\([_*\[\]()~`>#+\-=|{}.!]\)/\\\1/g' release_notes.txt > sanitized_notes.txt - # Store in env variable + # Save sanitized text to env { echo "RELEASE_NOTES<