Repository navigation
Announce releases in Slack when a webhook is configured - #18
Merged
Merged
Conversation
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.
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.
gpc/grails-datastore-rest-client-legacynotifies 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: newnotify-slackjob,needs: [release](so it only runs for a version that was actually released, after thereleaseenvironment approval).SLACK_WEBHOOK_URLsecret exists the steps are skipped with a notice. The secret is probed through a job-levelenv, since the secrets context cannot be used inif:.slackapi/slack-github-action@v1.27.0.jq(a quote in a tag name or release notes cannot break it) and passed withpayload-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
gpcorg already has aSLACK_WEBHOOK_URLsecret, so repos there will notify after the next sync.grails-pluginshas none, so those repos skip the job until one is added (org level covers all).Test plan
groovy .github/scripts/verify-repository.groovypassesjqpayload checked with a tag containing a quote and notes containing quotes/backslashes/CRLFgpcrepo, the message arrives in Slack