Skip to content

Commit 76b7994

Browse files
committed
feat: add automated Slack release notifications
Add GitHub Actions workflow that posts to Slack when a release is published: - Posts to #topic-cf-gitops-runtime with release version and link - Cross-posts to #team-support-announcements - Includes workflow_dispatch trigger for manual testing Update release guide: - Document that announcements are now automated - Add troubleshooting section for Slack notifications - Add Slack integration setup instructions in Reference section
1 parent 99a6274 commit 76b7994

File tree

2 files changed

+105
-19
lines changed

2 files changed

+105
-19
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# ABOUTME: GitHub Actions workflow that posts Slack notifications when a release is published.
2+
# ABOUTME: Notifies #topic-cf-gitops-runtime and cross-posts to #team-support-announcements.
3+
4+
name: Release Notification
5+
6+
on:
7+
release:
8+
types: [published]
9+
workflow_dispatch:
10+
inputs:
11+
tag:
12+
description: 'Release tag to simulate (e.g., 0.27.0)'
13+
required: true
14+
# TODO: Remove after first successful test
15+
push:
16+
branches:
17+
- docs/update-release-guide-validation-announcements
18+
19+
jobs:
20+
notify-slack:
21+
# Skip on push trigger - it's only used to register the workflow in Actions tab
22+
if: github.event_name != 'push'
23+
runs-on: ubuntu-latest
24+
env:
25+
RELEASE_TAG: ${{ github.event.release.tag_name || inputs.tag }}
26+
RELEASE_URL: ${{ github.event.release.html_url || format('https://github.com/{0}/releases/tag/{1}', github.repository, inputs.tag) }}
27+
steps:
28+
- name: Notify #topic-cf-gitops-runtime
29+
uses: slackapi/[email protected]
30+
with:
31+
method: chat.postMessage
32+
token: ${{ secrets.SLACK_BOT_TOKEN }}
33+
payload: |
34+
channel: ${{ vars.SLACK_CHANNEL_GITOPS_RUNTIME }}
35+
text: "GitOps Runtime ${{ env.RELEASE_TAG }} has been released"
36+
blocks:
37+
- type: header
38+
text:
39+
type: plain_text
40+
text: "🚀 GitOps Runtime Release"
41+
- type: section
42+
fields:
43+
- type: mrkdwn
44+
text: "*Version:*\n${{ env.RELEASE_TAG }}"
45+
- type: actions
46+
elements:
47+
- type: button
48+
text:
49+
type: plain_text
50+
text: "View Release Notes"
51+
url: ${{ env.RELEASE_URL }}
52+
53+
- name: Cross-post to #team-support-announcements
54+
uses: slackapi/[email protected]
55+
with:
56+
method: chat.postMessage
57+
token: ${{ secrets.SLACK_BOT_TOKEN }}
58+
payload: |
59+
channel: ${{ vars.SLACK_CHANNEL_SUPPORT_ANNOUNCEMENTS }}
60+
text: "GitOps Runtime ${{ env.RELEASE_TAG }} has been released"
61+
blocks:
62+
- type: section
63+
text:
64+
type: mrkdwn
65+
text: "*GitOps Runtime ${{ env.RELEASE_TAG }}* has been released.\n\n<${{ env.RELEASE_URL }}|View release notes>"

docs/RELEASE_GUIDE.md

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -208,27 +208,13 @@ Check the release:
208208
gh release view 0.27.0 --repo codefresh-io/gitops-runtime-helm
209209
```
210210
211-
### Step 5: Announce the Release
211+
### Step 5: Announcement (Automated)
212212
213-
After the release is published, announce it to the team:
213+
When a release is published, a GitHub Actions workflow automatically posts announcements to:
214+
- `#topic-cf-gitops-runtime` - Primary announcement with release version and link
215+
- `#team-support-announcements` - Cross-post for the support team
214216
215-
1. **Post in `#topic-cf-gitops-runtime`**:
216-
- Introduce the release with a brief summary of key changes
217-
- Include a link to the GitHub release notes
218-
219-
Example:
220-
```
221-
:rocket: GitOps Runtime v0.27.0 has been released!
222-
223-
Highlights:
224-
- [Key feature or fix 1]
225-
- [Key feature or fix 2]
226-
227-
Release notes: https://github.com/codefresh-io/gitops-runtime-helm/releases/tag/0.27.0
228-
```
229-
230-
2. **Cross-post to `#team-support-announcements`**:
231-
- Share the same announcement so the support team is aware of the new release
217+
No manual action required. If notifications don't appear, see [Troubleshooting: Slack Notifications Not Sent](#slack-notifications-not-sent).
232218
233219
---
234220
@@ -432,6 +418,25 @@ git push --force-with-lease
432418
gh release edit 0.27.0 --repo codefresh-io/gitops-runtime-helm --draft=false
433419
```
434420
421+
### Slack Notifications Not Sent
422+
423+
**Symptom**: Release published but no Slack notifications appeared
424+
425+
**Check**:
426+
1. Verify the `release-notification` workflow ran:
427+
- Go to Actions tab → "Release Notification" workflow
428+
- Check for failed runs
429+
2. If workflow failed, check for:
430+
- Missing `SLACK_BOT_TOKEN` secret
431+
- Missing `SLACK_CHANNEL_GITOPS_RUNTIME` or `SLACK_CHANNEL_SUPPORT_ANNOUNCEMENTS` variables
432+
- Bot not invited to the channels
433+
3. Manual fallback - post manually to Slack:
434+
```
435+
🚀 GitOps Runtime vX.Y.Z has been released!
436+
437+
Release notes: https://github.com/codefresh-io/gitops-runtime-helm/releases/tag/X.Y.Z
438+
```
439+
435440
---
436441
437442
## Reference
@@ -472,6 +477,22 @@ git push --force-with-lease
472477
|------|---------|
473478
| `charts/gitops-runtime/Chart.yaml` | Version, changelog annotations |
474479
| `charts/gitops-runtime/values.yaml` | Component versions, defaults |
480+
| `.github/workflows/release-notification.yaml` | Slack release announcements |
481+
482+
### Slack Integration Setup
483+
484+
The release notification workflow requires a Slack App with bot token. One-time setup:
485+
486+
1. **Create Slack App** at https://api.slack.com/apps
487+
2. **Add OAuth Scope**: Go to "OAuth & Permissions" → add `chat:write`
488+
3. **Install to Workspace**: Click "Install to Workspace" and authorize
489+
4. **Copy Bot Token**: Copy the "Bot User OAuth Token" (starts with `xoxb-`)
490+
5. **Get Channel IDs**: Right-click each channel → "View channel details" → copy the Channel ID
491+
6. **Invite Bot**: In each Slack channel, run `/invite @YourBotName`
492+
7. **Add to GitHub**:
493+
- Secret: `SLACK_BOT_TOKEN` → the bot token from step 4
494+
- Variable: `SLACK_CHANNEL_GITOPS_RUNTIME` → channel ID for #topic-cf-gitops-runtime
495+
- Variable: `SLACK_CHANNEL_SUPPORT_ANNOUNCEMENTS` → channel ID for #team-support-announcements
475496
476497
---
477498

0 commit comments

Comments
 (0)