Skip to content

Update announcement.yml #6

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
20 changes: 10 additions & 10 deletions .github/workflows/announcement.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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<<EOF"
cat sanitized_notes.txt
Expand All @@ -35,12 +34,13 @@ jobs:
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
format: MarkdownV2
message: |
✅ **Release Merged to Main**
🔗 [PR #${{ github.event.pull_request.number }}](${{ github.event.pull_request.html_url }})
✅ *Release Merged to Main*
🔗 [PR \#${{ github.event.pull_request.number }}](${{ github.event.pull_request.html_url }})
👤 Author: [${{ github.event.pull_request.user.login }}](https://github.com/${{ github.event.pull_request.user.login }})

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