Skip to content

Add Discord release announcements - #54

Merged
Solvely-Colin merged 1 commit into
open-gsd:mainfrom
Solvely-Colin:fix/discord-release-announcements
Jun 14, 2026
Merged

Solvely-Colin merged 1 commit into
open-gsd:mainfrom
Solvely-Colin:fix/discord-release-announcements

Conversation

@Solvely-Colin

@Solvely-Colin Solvely-Colin commented Jun 14, 2026 •

Copy link
Copy Markdown
Member

Summary

  • add a Discord changelog workflow for published releases and manual dispatches
  • post a Discord announcement from the tag/manual release workflow after GitHub release creation
  • add a tested release-summary formatter for Discord webhook payloads

Validation

  • node --test tests/discord-release-summary.test.cjs
  • ruby -e 'require "yaml"; ARGV.each { |f| YAML.load_file(f); puts "ok #{f}" }' .github/workflows/release.yml .github/workflows/discord-changelog.yml
  • git diff --check -- .github/workflows/release.yml .github/workflows/discord-changelog.yml scripts/release-notes/discord-release-summary.cjs tests/discord-release-summary.test.cjs

Note: DISCORD_CHANGELOG_WEBHOOK is now configured in the target repo secrets.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Copilot AI review requested due to automatic review settings June 14, 2026 16:37
@Solvely-Colin
Solvely-Colin merged commit 3241e57 into open-gsd:main Jun 14, 2026
8 checks passed
@Solvely-Colin
Solvely-Colin deleted the fix/discord-release-announcements branch June 14, 2026 16:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-summary Node 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:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants