Add Telegram Notifier to Nightly CI pipeline#1934
Add Telegram Notifier to Nightly CI pipeline#1934UnschooledGamer merged 18 commits intoAcode-Foundation:mainfrom
Conversation
Updated community release notifier workflow to include Telegram notifications and improved variable handling.
Add Telegram bot secrets to nightly-build.yml
Greptile SummaryThis PR adds Telegram notification support to the community release notifier. The implementation correctly handles most concerns raised in previous review rounds: ✅ Addressed in this revision:
For maximum flexibility in a reusable workflow, consider:
The current implementation works correctly for callers that always provide Telegram credentials. Confidence Score: 4/5
Sequence DiagramsequenceDiagram
participant NB as nightly-build.yml
participant CRN as community-release-notifier.yml
participant Bash as Runner (bash)
participant Discord
participant Telegram
NB->>CRN: workflow_call (tag, url, body, secrets)
CRN->>Bash: Prepare release variables (env: isolated)
Bash->>Bash: Escape body/tag for MarkdownV2 → body_safe, tag_safe
Bash->>Bash: Build ANNOUNCE_SAFE (Telegram MarkdownV2)
Bash->>Bash: Build ANNOUNCE_PLAIN (Discord plain MD)
Bash-->>CRN: outputs: announce, body_safe, announce_plain, body_plain
CRN->>CRN: Truncate message for Discord (≤2000 chars)
CRN->>Discord: POST webhook (announce_plain + body_plain)
alt TELEGRAM_BOT_TOKEN ≠ "" AND CHAT_ID ≠ "" AND THREAD_ID ≠ ""
CRN->>Telegram: Send MarkdownV2 message (announce + body_safe, thread_id)
else any Telegram secret is empty
CRN-->>CRN: Skip Telegram step (continue-on-error)
end
Last reviewed commit: 5d852f2 |
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This comment was marked as outdated.
This comment was marked as outdated.
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
| stringToTruncate: | | ||
| ${{ steps.vars.outputs.announce }} | ||
|
|
||
| ${{ steps.vars.outputs.body_safe }} |
There was a problem hiding this comment.
MarkdownV2-escaped content sent to Discord
steps.vars.outputs.announce and steps.vars.outputs.body_safe are both escaped for Telegram's MarkdownV2 format (backslash-prefixing ., -, !, #, (, ), etc.). This same escaped content is fed directly into the Discord notification.
Discord uses a different markdown dialect: it only strips a leading \ before its own special characters (*, _, `, ~, |). For every other character, a \ is displayed literally. This means:
- A release note with
"Added version 1.2.3"will appear as"Added version 1\.2\.3"in Discord. - A tag like
v1.0.0-nightlyin the announce line will appear asv1\.0\.0\-nightlyinside the Discord link text. - Any
!escaped as\!, or#escaped as\#, etc. will all show visible backslashes in Discord.
The fix is to produce two separate outputs from the vars step — one for Telegram (MarkdownV2-escaped) and one for Discord (raw/unescaped) — and feed each to the appropriate notification step:
# In the vars step:
echo "announce_plain=📢 Acode $TAG ($URL) was just Released 🎉${SUFFIX_PLAIN}!" >> $GITHUB_OUTPUT
{
echo "body_plain<<$DELIMITER"
printf '%s\n' "$INPUT_BODY"
echo "$DELIMITER"
} >> $GITHUB_OUTPUT
# In the Discord truncate step:
stringToTruncate: |
${{ steps.vars.outputs.announce_plain }}
${{ steps.vars.outputs.body_plain }}Mobile edits 😶🙏🙃
Another mobile edits 😶
This comment has been minimized.
This comment has been minimized.
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
No description provided.