Skip to content

Commit a6d4d04

Browse files
authored
Update announcement.yml
1 parent 27192ba commit a6d4d04

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

.github/workflows/announcement.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,19 @@ jobs:
1414
- name: Extract Release Notes
1515
id: extract
1616
run: |
17-
BODY="${{ github.event.pull_request.body }}"
17+
# Save PR body to file
18+
echo "${{ github.event.pull_request.body }}" > pr_body.md
1819
1920
# Extract everything from "# Releases" onward
20-
RELEASE_NOTES=$(echo "$BODY" | awk '/^# Releases/{flag=1} flag')
21-
22-
# Sanitize: escape backticks (which break Telegram markdown code blocks)
23-
RELEASE_NOTES="${RELEASE_NOTES//\`/\\\`}"
24-
25-
# Write to environment variable safely
21+
awk '/^# Releases/ {found=1} found' pr_body.md > release_notes.txt
22+
23+
# Escape backticks to keep Telegram Markdown happy
24+
sed 's/`/\\`/g' release_notes.txt > sanitized_notes.txt
25+
26+
# Store in env variable
2627
{
2728
echo "RELEASE_NOTES<<EOF"
28-
echo "$RELEASE_NOTES"
29+
cat sanitized_notes.txt
2930
echo "EOF"
3031
} >> "$GITHUB_ENV"
3132

0 commit comments

Comments
 (0)