feat(telegram): centralize message format in telegram-notify.yml - #33
Merged
Conversation
Add a single formatter workflow that owns all Telegram message layout - emoji, labels, field order, spacing, 300-char body truncation, and the derived Repository line. Callers pass structured data through typed inputs and select layout with a required event_type; they never supply a message body. Vocabulary covers PR/CI events plus deploy/terraform/drift so the whole estate renders one format. Migrate the 9 PR/CI handlers to call it. pr-commented, pr-review-comment, pr-review, and ci-status drop their github-script jobs entirely, since truncation and state-to-emoji mapping now live in the formatter. Existing messages render byte-for-byte identical. Self-contained (formats and sends) because GitHub caps nested reusable workflows at 4 levels and the chain is already consumer -> notify -> handler -> here. Document the formatter and deploy/terraform events in the README; drop the phantom pr-labeled entries and align examples to @main. Record the decision in docs/adr/0001. send-telegram-message.yml stays for now; its external callers migrate before it is removed.
This was referenced Aug 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
telegram-notify.yml, the single formatter that owns all Telegram message layout: emoji, labels, field order, spacing, 300-char body truncation, and the derived Repository lineevent_type; there is no free-formmessageinput, so every notification renders one formatdeploy_*/terraform_*/driftpr-commented,pr-review-comment,pr-review, andci-statusdrop theirgithub-scriptjobs entirely (truncation and state-to-emoji mapping moved into the formatter)Why self-contained
The formatter both formats and sends. GitHub caps nested reusable workflows at 4 levels, and the chain is already
consumer -> notify.yml -> handler -> telegram-notify.yml. Delegating the send to a further workflow would be a fifth level and fail to run. Rationale recorded indocs/adr/0001-central-telegram-message-formatter.md.Docs
pr-labeledentries (no such workflow exists) and align the Telegram examples to@mainRollout
This is phase 1 of 3.
send-telegram-message.ymlstays in place so its 5 external callers keep working. Phases 2 (migrate those repos onto the formatter) and 3 (delete the raw sender) follow.Verification
actionlintclean across all workflows (includes shellcheck on the send step)