diff --git a/.github/workflows/announcement.yml b/.github/workflows/announcement.yml index 159e7fc..3bc5d11 100644 --- a/.github/workflows/announcement.yml +++ b/.github/workflows/announcement.yml @@ -11,21 +11,18 @@ jobs: runs-on: ubuntu-latest steps: - - name: Extract and sanitize release notes + - name: Extract release notes id: extract run: | echo "${{ github.event.pull_request.body }}" > pr_body.md - # Extract lines AFTER "# Releases" + # Extract lines AFTER "# Releases" line awk '/^# Releases/ {found=1; next} found' pr_body.md > release_notes.txt - # Escape characters for Telegram MarkdownV2 - sed -e 's/\([_*\[\]()~`>#+\-=|{}.!]\)/\\\1/g' release_notes.txt > sanitized_notes.txt - - # Save sanitized text to env + # Save as-is to environment variable (no escaping needed inside ``` block) { echo "RELEASE_NOTES<> "$GITHUB_ENV" @@ -42,3 +39,5 @@ jobs: 📦 *Release Notes:* ``` + ${{ env.RELEASE_NOTES }} + ```