Skip to content

Commit 2afccdd

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 c980f4a commit 2afccdd

File tree

2 files changed

+84
-19
lines changed

2 files changed

+84
-19
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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+
15+
jobs:
16+
notify-slack:
17+
runs-on: ubuntu-latest
18+
env:
19+
RELEASE_TAG: ${{ github.event.release.tag_name || inputs.tag }}
20+
RELEASE_URL: ${{ github.event.release.html_url || format('https://github.com/{0}/releases/tag/{1}', github.repository, inputs.tag) }}
21+
steps:
22+
- name: Notify #topic-cf-gitops-runtime
23+
uses: slackapi/[email protected]
24+
with:
25+
method: chat.postMessage
26+
token: ${{ secrets.SLACK_BOT_TOKEN }}
27+
payload: |
28+
channel: ${{ vars.SLACK_CHANNEL_GITOPS_RUNTIME }}
29+
text: "GitOps Runtime ${{ env.RELEASE_TAG }} has been released"
30+
blocks:
31+
- type: header
32+
text:
33+
type: plain_text
34+
text: "🚀 GitOps Runtime Release"
35+
- type: section
36+
fields:
37+
- type: mrkdwn
38+
text: "*Version:*\n${{ env.RELEASE_TAG }}"
39+
- type: actions
40+
elements:
41+
- type: button
42+
text:
43+
type: plain_text
44+
text: "View Release Notes"
45+
url: ${{ env.RELEASE_URL }}
46+
47+
- name: Cross-post to #team-support-announcements
48+
uses: slackapi/[email protected]
49+
with:
50+
method: chat.postMessage
51+
token: ${{ secrets.SLACK_BOT_TOKEN }}
52+
payload: |
53+
channel: ${{ vars.SLACK_CHANNEL_SUPPORT_ANNOUNCEMENTS }}
54+
text: "GitOps Runtime ${{ env.RELEASE_TAG }} has been released"
55+
blocks:
56+
- type: section
57+
text:
58+
type: mrkdwn
59+
text: "*GitOps Runtime ${{ env.RELEASE_TAG }}* has been released.\n\n<${{ env.RELEASE_URL }}|View release notes>"

docs/RELEASE_GUIDE.md

Lines changed: 25 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,7 @@ 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 |
475481
476482
---
477483

0 commit comments

Comments
 (0)