Skip to content

Commit 075aa05

Browse files
authored
Merge pull request #6 from code-with-amirhossein/amir78729-patch-6
Update announcement.yml
2 parents 36dff66 + e755f38 commit 075aa05

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

.github/workflows/announcement.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,18 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- name: Extract Release Notes
14+
- name: Extract and sanitize release notes
1515
id: extract
1616
run: |
17-
# Save PR body to file
1817
echo "${{ github.event.pull_request.body }}" > pr_body.md
19-
20-
# Extract everything from "# Releases" onward
18+
19+
# Extract lines from "# Releases" onward
2120
awk '/^# Releases/ {found=1} found' pr_body.md > release_notes.txt
2221
23-
# Escape backticks to keep Telegram Markdown happy
24-
sed 's/`/\\`/g' release_notes.txt > sanitized_notes.txt
22+
# Escape characters for Telegram MarkdownV2
23+
sed -e 's/\([_*\[\]()~`>#+\-=|{}.!]\)/\\\1/g' release_notes.txt > sanitized_notes.txt
2524
26-
# Store in env variable
25+
# Save sanitized text to env
2726
{
2827
echo "RELEASE_NOTES<<EOF"
2928
cat sanitized_notes.txt
@@ -35,12 +34,13 @@ jobs:
3534
with:
3635
to: ${{ secrets.TELEGRAM_TO }}
3736
token: ${{ secrets.TELEGRAM_TOKEN }}
37+
format: MarkdownV2
3838
message: |
39-
✅ **Release Merged to Main**
40-
🔗 [PR #${{ github.event.pull_request.number }}](${{ github.event.pull_request.html_url }})
39+
✅ *Release Merged to Main*
40+
🔗 [PR \#${{ github.event.pull_request.number }}](${{ github.event.pull_request.html_url }})
4141
👤 Author: [${{ github.event.pull_request.user.login }}](https://github.com/${{ github.event.pull_request.user.login }})
4242
43-
📦 **Release Notes:**
43+
📦 *Release Notes:*
4444
```
4545
${{ env.RELEASE_NOTES }}
4646
```

0 commit comments

Comments
 (0)