-
Notifications
You must be signed in to change notification settings - Fork 8
59 lines (55 loc) · 2.13 KB
/
release-notification.yaml
File metadata and controls
59 lines (55 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# ABOUTME: GitHub Actions workflow that posts Slack notifications when a release is published.
# ABOUTME: Notifies #topic-cf-gitops-runtime and cross-posts to #team-support-announcements.
name: Release Notification
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: 'Release tag to simulate (e.g., 0.27.0)'
required: true
jobs:
notify-slack:
runs-on: ubuntu-latest
env:
RELEASE_TAG: ${{ github.event.release.tag_name || inputs.tag }}
RELEASE_URL: ${{ github.event.release.html_url || format('https://github.com/{0}/releases/tag/{1}', github.repository, inputs.tag) }}
steps:
- name: Notify #topic-cf-gitops-runtime
uses: slackapi/slack-github-action@v2.1.1
with:
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload: |
channel: ${{ vars.SLACK_CHANNEL_GITOPS_RUNTIME }}
text: "GitOps Runtime ${{ env.RELEASE_TAG }} has been released"
blocks:
- type: header
text:
type: plain_text
text: "🚀 GitOps Runtime Release"
- type: section
fields:
- type: mrkdwn
text: "*Version:*\n${{ env.RELEASE_TAG }}"
- type: actions
elements:
- type: button
text:
type: plain_text
text: "View Release Notes"
url: ${{ env.RELEASE_URL }}
- name: Cross-post to #team-support-announcements
uses: slackapi/slack-github-action@v2.1.1
with:
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload: |
channel: ${{ vars.SLACK_CHANNEL_SUPPORT_ANNOUNCEMENTS }}
text: "GitOps Runtime ${{ env.RELEASE_TAG }} has been released"
blocks:
- type: section
text:
type: mrkdwn
text: "*GitOps Runtime ${{ env.RELEASE_TAG }}* has been released.\n\n<${{ env.RELEASE_URL }}|View release notes>"