Skip to content

Announce releases in Slack when a webhook is configured - #18

Merged
sbglasius merged 1 commit into
mainfrom
feature/slack-release-notification
Oct 14, 2026
Merged

sbglasius merged 1 commit into
mainfrom
feature/slack-release-notification

Conversation

@sbglasius

Copy link
Copy Markdown
Collaborator

gpc/grails-datastore-rest-client-legacy notifies the Grails Community Slack when a plugin is released. Add the same to the release workflow every synced repo gets.

Changes

  • .github/sync/workflows/release.yml: new notify-slack job, needs: [release] (so it only runs for a version that was actually released, after the release environment approval).
  • If no SLACK_WEBHOOK_URL secret exists the steps are skipped with a notice. The secret is probed through a job-level env, since the secrets context cannot be used in if:.
  • Message: a link to the GitHub release and its release notes, sent with slackapi/slack-github-action@v1.27.0.
  • Differences from the legacy version: the JSON payload is built with jq (a quote in a tag name or release notes cannot break it) and passed with payload-file-path, and the release notes are cut to 2800 characters (Slack's section text limit is 3000).
  • TEMPLATE_README.md: short "Slack Release Notification" section.

Notes

  • The gpc org already has a SLACK_WEBHOOK_URL secret, so repos there will notify after the next sync. grails-plugins has none, so those repos skip the job until one is added (org level covers all).
  • Not sent to a real Slack workspace yet.

Test plan

  • workflow YAML parses; groovy .github/scripts/verify-repository.groovy passes
  • jq payload checked with a tag containing a quote and notes containing quotes/backslashes/CRLF
  • After the next sync and a release in a gpc repo, the message arrives in Slack
  • In a repo without the secret, the job logs the skip notice and succeeds

Add a notify-slack job to the child release workflow, modelled on the one in
gpc/grails-datastore-rest-client-legacy. It runs after the release job and is
skipped when no SLACK_WEBHOOK_URL secret exists. The payload is built with jq
so quotes in a tag or release notes cannot break it, and the notes are cut to
Slack's section limit.
@sbglasius
sbglasius merged commit 13aa4ae into main Oct 14, 2026
5 checks passed
@sbglasius
sbglasius deleted the feature/slack-release-notification branch October 14, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant