Skip to content

ci: notify Discord when a new version is published - #335

Merged
JonasJesus42 merged 1 commit into
mainfrom
ci-discord-release-notify
Sep 2, 2026
Merged

ci: notify Discord when a new version is published#335
JonasJesus42 merged 1 commit into
mainfrom
ci-discord-release-notify

Conversation

@JonasJesus42

@JonasJesus42 JonasJesus42 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Notifies the Parity update Discord channel whenever a new version lands on npm.

Why a step in publish.yml and not a new workflow

The step hangs off the end of the existing publish job instead of being its own on: release workflow, because that job has already computed the version — a separate workflow would have to re-derive "what's the new version", giving us two sources of truth for the thing most likely to drift.

It only runs on success(), so a failed publish stays silent, and it's continue-on-error: true: a notification failing must never turn a green publish red. The package is on npm either way; nobody seeing a Discord message is not a release failure.

Secret, not a file

decocms/parity is public, so the webhook URL is not in the workflow — it's stored as the DISCORD_WEBHOOK repo secret (already set). The step skips quietly when the secret is absent, which is the case on forks and for contributors without secret access.

The payload is assembled with jq rather than string-interpolated, since the version flows in from CI output and hand-rolled JSON breaks on quotes.

Verified before merge

  • Webhook is live — checked with a GET (returns the webhook object, posts nothing): channel Parity update
  • publish.yml parses as YAML, 11 steps
  • The jq payload emits valid JSON
  • No discord.com/api/webhooks string anywhere in the file

Not yet verified: an actual delivered message. That happens on the next merge to main — which this PR is, so this release is its own test.

🤖 Generated with Claude Code


Summary by cubic

The publish workflow now notifies the Parity update Discord channel when a new @decocms/parity version reaches npm. Failed publishes stay silent, and a failed Discord notification does not affect the publish job.

  • Reuses the version and tag already computed by the publish job.
  • Reads the webhook from DISCORD_WEBHOOK and skips quietly when it is unavailable.
  • Includes the npm install command and GitHub release link in a JSON-safe payload.

Written for commit 8812431. Summary will update on new commits.

Review in cubic

Hangs off the end of the publish job rather than a separate `on: release`
workflow, so it reuses the version this run already computed instead of
re-deriving it -- one source of truth for "what's a new version".

continue-on-error so a failed notification never turns a green publish red,
and if: success() so a failed publish stays silent.

The repo is public, so the webhook URL is a secret (DISCORD_WEBHOOK), not a
literal; the step skips quietly when it's absent (forks, outside contributors).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@JonasJesus42
JonasJesus42 merged commit 8e0c78b into main Sep 2, 2026
2 checks passed
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.

1 participant