Skip to content

Commit 31f8eb4

Browse files
chore(community-release-notifier): Change sed parsing - TG release notes (#2832)
* chore(community-release-notifier): Change sed parsing - TG release notes This commit fixes Release notes not being sed escaped properly leading towards Telegram notifier failing for Stable Releases as they were auto-generated by git. * Disable markdown format in community release notifier Commented out the markdown format option in the Telegram notifier.
1 parent eac9b6e commit 31f8eb4

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎.github/workflows/community-release-notifier.yml‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
id: vars
5757
env:
5858
INPUT_TAG: ${{ github.event.release.tag_name || inputs.tag_name }}
59-
INPUT_URL: ${{ github.event.release.url || inputs.url }}
59+
INPUT_URL: ${{ github.event.release.html_url || inputs.url }}
6060
INPUT_BODY: ${{ github.event.release.body || inputs.body }}
6161
run: |
6262
TAG="$INPUT_TAG"
@@ -68,7 +68,12 @@ jobs:
6868
# Escape problematic characters for MarkdownV2 (very conservative escaping)
6969
# We escape: _ * [ ] ( ) ~ ` > # + - = | { } . ! \
7070
BODY_SAFE=$(printf '%s' "$INPUT_BODY" | \
71-
sed 's/[_*[\]()~`>#+=|{}.!\\-]/\\&/g')
71+
sed -E \
72+
-e 's/^[[:space:]]*##[[:space:]]*//' \
73+
-e 's/^[[:space:]]*\*[[:space:]]+/- /' \
74+
-e 's/\*\*([^*]*)\*\*/\*\1\*/g' \
75+
-e 's/\\!/!/g' \
76+
-e 's/@([A-Za-z0-9-]+)/@\1/g')
7277
TAG_SAFE=$(printf '%s' "$TAG" | sed 's/[_*[\]()~`>#+=|{}.!\\-]/\\&/g')
7378
7479
if [[ "$TAG" == *"-nightly"* ]]; then
@@ -140,7 +145,8 @@ jobs:
140145
${{ steps.vars.outputs.announce }}
141146
142147
${{ steps.vars.outputs.body_safe }}
143-
format: markdown
148+
# disabled for time being see https://github.com/Acode-Foundation/Acode/pull/2832#discussion_r3887130617
149+
#format: markdown
144150
disable_web_page_preview: true
145151
# Only needed for topic-enabled supergroups/channels
146152
message_thread_id: ${{ secrets.TELEGRAM_MESSAGE_THREAD_ID }}

0 commit comments

Comments
 (0)