Skip to content

Update announcement.yml #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions .github/workflows/announcement.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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<<EOF"
cat sanitized_notes.txt
cat release_notes.txt
echo "EOF"
} >> "$GITHUB_ENV"

Expand All @@ -42,3 +39,5 @@ jobs:

📦 *Release Notes:*
```
${{ env.RELEASE_NOTES }}
```