Repository navigation
Add Discord release announcements - #54
Merged
Solvely-Colin merged 1 commit intoJun 14, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds automated Discord announcements for releases by introducing a reusable Node formatter + webhook poster, then wiring it into GitHub Actions so published releases (and manual runs) can post a condensed changelog to Discord.
Changes:
- Added
discord-release-summaryNode CLI to format GitHub release notes into a Discord webhook payload and optionally post it. - Added Node tests covering payload formatting, section classification, bullet cleanup, and package name resolution.
- Updated release automation and introduced a new workflow to post release changelogs to Discord.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
scripts/release-notes/discord-release-summary.cjs |
New CLI for building/posting Discord release announcements from GitHub release data. |
tests/discord-release-summary.test.cjs |
New tests validating formatter behavior and parsing/cleanup logic. |
.github/workflows/release.yml |
Posts a Discord announcement after creating the GitHub release. |
.github/workflows/discord-changelog.yml |
New workflow to post changelogs on release.published and via manual dispatch. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+358
to
+361
| async function main() { | ||
| const opts = parseArgs(process.argv.slice(2)); | ||
| const release = opts.stdin ? JSON.parse(fs.readFileSync('/dev/stdin', 'utf8')) : fetchRelease(opts); | ||
| const payload = buildDiscordReleasePayload({ |
Comment on lines
+205
to
+207
| if (lines.length === baseLines.length) { | ||
| appendLineGroup(lines, ['', 'No release notes were provided.'], footer, maxContent); | ||
| } |
Comment on lines
+324
to
+349
| } else if (arg === '--help' || arg === '-h') { | ||
| process.stdout.write( | ||
| 'Usage: node scripts/release-notes/discord-release-summary.cjs [--tag <tag>|--latest|--stdin] [options]\n' + | ||
| '\n' + | ||
| 'Options:\n' + | ||
| ' --tag <tag> GitHub release tag to announce\n' + | ||
| ' --latest Announce the latest GitHub release\n' + | ||
| ' --stdin Read release JSON from stdin\n' + | ||
| ' --repo <owner/repo> Repository for gh release view\n' + | ||
| ' --package <name> Package name override\n' + | ||
| ' --post POST to DISCORD_WEBHOOK_URL\n' + | ||
| ' --allow-missing-webhook Warn and skip instead of failing when posting without a webhook\n' + | ||
| ' --json Print webhook payload JSON instead of content preview\n' + | ||
| ' --max-content <n> Max Discord content characters before webhook footer\n' | ||
| ); | ||
| throw new ExitError(0); | ||
| } else { | ||
| throw new ExitError(2, `error: unknown argument ${arg}`); | ||
| } | ||
| } | ||
|
|
||
| if (!Number.isFinite(opts.maxContent) || opts.maxContent < 500 || opts.maxContent > 2000) { | ||
| throw new ExitError(2, 'error: --max-content must be between 500 and 2000'); | ||
| } | ||
|
|
||
| return opts; |
Comment on lines
+280
to
+288
| async function postWebhook(webhookUrl, payload) { | ||
| const response = await fetch(webhookUrl, { | ||
| method: 'POST', | ||
| headers: { 'content-type': 'application/json' }, | ||
| body: JSON.stringify(payload), | ||
| }); | ||
|
|
||
| if (!response.ok) throw new ExitError(1, `Discord webhook failed with ${response.status}: ${await response.text()}`); | ||
| } |
Comment on lines
+18
to
+21
| discord-changelog: | ||
| runs-on: ubuntu-latest | ||
| if: github.event_name == 'release' || github.event_name == 'workflow_dispatch' | ||
| steps: |
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
Validation
Note: DISCORD_CHANGELOG_WEBHOOK is now configured in the target repo secrets.
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.