Announce releases to Discord (#announcements)#19
Merged
Conversation
On `release: published`, format an announcement mechanically from the GitHub Release (title + lead paragraph, word-boundary capped at 280 chars, + a "Full release notes" link) and POST it to the Discord #announcements webhook. - `.github/workflows/announce.yml` — fires on release publish + a manual workflow_dispatch (with a dry_run input for testing). Decoupled from publish.yml so a failure here never affects publishing. - `.github/scripts/announce-discord.mjs` — transport-agnostic formatter + webhook POST (node builtins only, no deps). Lives as a standalone script so it can move into a shared action verbatim when we extend to nimblebrain / mpak. Safe to merge before the webhook exists: with `DISCORD_ANNOUNCE_WEBHOOK` unset the job runs, prints the payload, and skips the post (green run, no release impact). Set the secret, then dispatch with tag v0.10.2 to send the first announcement.
When the release body has no prose lead paragraph (e.g. a CHANGELOG that leads with '### Fixed', or a manually-cut release using GitHub's auto-generated notes), the formatter posts generic copy. Emit a ::warning:: so that silent degradation is visible in the run log instead of shipping a content-free announcement unnoticed — matters most once this script backs nimblebrain/mpak, whose CHANGELOG formats we don't control.
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.
Ships Variant A of the release-announcement system: the release pipeline announces itself, CI-native, zero standing infra.
What it does
On
release: published, a job formats an announcement mechanically from the GitHub Release (title + lead paragraph, word-boundary capped at 280 chars, + a "Full release notes →" link) and POSTs it to the Discord #announcements webhook. Markdown carries over to the Discord embed (inline code, bold, the title links to the release).Rendered first post (synapse v0.10.2):
Files
.github/workflows/announce.yml— triggers on release publish + a manualworkflow_dispatch(with adry_runinput). Decoupled frompublish.ymlso a failure here never affects publishing.permissions: contents: read..github/scripts/announce-discord.mjs— transport-agnostic formatter + webhook POST. Node builtins only (no deps). Standalone so it can move into a shared action verbatim when we extend to nimblebrain / mpak.Safe to merge before the webhook exists
With
DISCORD_ANNOUNCE_WEBHOOKunset, the job runs, prints the payload it would have sent, and skips the POST — green run, no release impact. So this can land now and start posting the moment the secret is added.Activation (one-time, manual — needs Discord + repo/org admin)
DISCORD_ANNOUNCE_WEBHOOK(repo secret for the guinea-pig; promote to an org secret when we roll out to nimblebrain/mpak so all repos share one).v0.10.2(optionallydry_run: truefirst to preview in the run log).Next (separate)
announce-discord.mjsinto a shared action and add the ~15-line caller to nimblebrain (then mpak).