Skip to main content

Example: one repository, several destinations

Example: one repository, several destinations

Halyard builds halyard/sync-engine. The developers read Slack, the community meets on Discord, a group of customers follows a Telegram channel, and an internal status page wants to know about every version too. Every release should reach all four.

How the team works

Ordinary releases with notes, v5.3.0, published from main.

The rules

A rule posts to one destination, so this takes four rules for the same repository, one per destination. Connect each destination first on the destinations page; the wizard offers the ones that are connected.

Slack Discord Telegram Webhook
Where should it post? the workspace, then a channel under Which channel? the server's channel, chosen when it was connected the chat, chosen when it was connected the endpoint, chosen when it was connected
Which template? Use the default, or one per destination the same the same the same

The other switches can differ per rule, which is one reason to keep four rules rather than one: the customers' Telegram channel might want Include pre-releases off while the developers' Slack channel has it on.

What differs per destination

Slack Discord Telegram Webhook
The notes converted to Slack's formatting converted to Discord's Markdown converted to Telegram's formatting not sent; the payload carries the repository, the tag, the title, the pre-release state, the link and the time
The limit of the destination 3,000 characters per section 4,096 characters in the description 4,096 characters per message —
How it appears (Compact or Thread) offered not offered not offered not offered
Collect a burst of releases into one message offered not offered not offered not offered
Commits pushed to a branch offered not offered not offered not offered

The notes are cut twice, for two different reasons. The template sets how much of them belongs in a message, 1,200 characters unless it says otherwise, and that cut is silent: it is what the template asked for. The destination's own limit is the second, and a message cut there says so at its end, with a link to the full notes.

Wherever a cut falls, it never leaves a formatting mark half open: a code block, a bold title or a link that would not fit goes as a whole.

What arrives

The same release, four times, each in the shape its destination draws. Update the message when the release notes are edited and If the release is deleted on GitHub work per rule: Slack, Discord and Telegram change or remove the message they posted, and the webhook endpoint receives a release.updated or a release.deleted event.

A webhook delivery is signed: the endpoint can check the webhook-signature header and refuse anything it does not recognize.

What can go wrong

  • One destination disconnects, a Slack app removed or a Discord channel deleted. Its rule stops, says why on the rules page, and the other three carry on.
  • A private Slack channel stays empty until the app is invited into it. Posting into a private channel has the command.
  • Long notes look complete in one destination and cut in another, because the limits differ. The link at the end of a cut message leads to the full notes on GitHub.