-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathembedded-cluster-release-notes.yml
More file actions
95 lines (82 loc) · 3.4 KB
/
embedded-cluster-release-notes.yml
File metadata and controls
95 lines (82 loc) · 3.4 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: embedded-cluster-release-notes
on:
repository_dispatch:
types: [embedded-cluster-release-notes]
inputs:
version:
description: Embedded Cluster version
required: true
jobs:
generate-release-notes-pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Generate Release Notes
id: release-notes
env:
EC_VERSION: ${{ github.event.client_payload.version }}
uses: replicatedhq/release-notes-generator@main
with:
owner-repo: replicatedhq/embedded-cluster
head: $EC_VERSION
title: ${EC_VERSION#v}
description: ''
include-pr-links: false
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Update Release Notes
env:
PATTERN: ".+RELEASE_NOTES_PLACEHOLDER.+"
EC_VERSION: ${{ github.event.client_payload.version }}
run: |
# Extract EC version without v prefix if it exists
EC_VERSION_CLEAN=${EC_VERSION#v}
# Create the full release notes content
cat > /tmp/release-notes.txt << EOF
## ${EC_VERSION_CLEAN}
Released on $(date +'%B %-d, %Y')
<!-- VERSION TABLE PLACEHOLDER
Please manually replace this placeholder with a version table in the format:
<table>
<tr>
<th>Version</th>
<td id="center">X.Y.Z+k8s-1.XX</td>
<td id="center">X.Y.Z+k8s-1.XX</td>
</tr>
<tr>
<th>Kubernetes Version</th>
<td id="center">1.XX.Y</td>
<td id="center">1.XX.Y</td>
</tr>
<tr>
<th>KOTS Version</th>
<td id="center" colspan="2">1.XXX.Y</td>
</tr>
</table>
-->
${{ steps.release-notes.outputs.release-notes }}
EOF
sed -i -E "/$PATTERN/r /tmp/release-notes.txt" docs/release-notes/rn-embedded-cluster.md
rm -f /tmp/release-notes.txt
- name: Create Pull Request
uses: peter-evans/create-pull-request@v8
id: cpr
with:
token: ${{ secrets.REPLICATED_GH_PAT }}
commit-message: Embedded Cluster ${{ github.event.client_payload.version }} release notes
title: Embedded Cluster ${{ github.event.client_payload.version }} release notes
branch: automation/embedded-cluster-release-notes-${{ github.event.client_payload.version }}
delete-branch: true
base: "main"
body: "Automated changes by the [embedded-cluster-release-notes](https://github.com/replicatedhq/replicated-docs/blob/main/.github/workflows/embedded-cluster-release-notes.yml) GitHub action. Please manually replace the version table placeholder."
- name: Check outputs
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
- name: Slack Notification
uses: slackapi/slack-github-action@v3.0.1
with:
webhook: ${{ secrets.EMBEDDED_CLUSTER_RELEASE_NOTES_SLACK_WEBHOOK }}
webhook-type: webhook-trigger
payload: |
version: "${{ github.event.client_payload.version }}"
pull_request_url: "${{steps.cpr.outputs.pull-request-url}}"