Skip to content

Commit 307c461

Browse files
committed
update workflow
1 parent 0468d52 commit 307c461

File tree

1 file changed

+77
-77
lines changed

1 file changed

+77
-77
lines changed

.github/workflows/embedded-cluster-release-notes.yml

Lines changed: 77 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -11,85 +11,85 @@ jobs:
1111
generate-release-notes-pr:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v4
1515

16-
- name: Generate Release Notes
17-
id: release-notes
18-
env:
19-
EC_VERSION: ${{ github.event.inputs.version }}
20-
uses: replicatedhq/release-notes-generator@main
21-
with:
22-
owner-repo: replicatedhq/embedded-cluster
23-
head: $EC_VERSION
24-
title: ${EC_VERSION#v}
25-
description: ''
26-
include-pr-links: false
27-
github-token: ${{ secrets.GITHUB_TOKEN }}
16+
- name: Generate Release Notes
17+
id: release-notes
18+
env:
19+
EC_VERSION: ${{ github.event.inputs.version }}
20+
uses: replicatedhq/release-notes-generator@main
21+
with:
22+
owner-repo: replicatedhq/embedded-cluster
23+
head: $EC_VERSION
24+
title: ${EC_VERSION#v}
25+
description: ''
26+
include-pr-links: false
27+
github-token: ${{ secrets.GITHUB_TOKEN }}
2828

29-
- name: Update Release Notes
30-
env:
31-
PATTERN: ".+RELEASE_NOTES_PLACEHOLDER.+"
32-
EC_VERSION: ${{ github.event.inputs.version }}
33-
run: |
34-
# Remove any suffix after the + character to get clean semver
35-
EC_VERSION_CLEAN=${EC_VERSION%%+*}
36-
37-
# Create the full release notes content
38-
cat > /tmp/release-notes.txt << EOF
39-
40-
## ${EC_VERSION_CLEAN}
41-
42-
Released on $(date +'%B %-d, %Y')
43-
44-
<!-- VERSION TABLE PLACEHOLDER
45-
Please manually replace this placeholder with a version table in the format:
46-
47-
<table>
48-
<tr>
49-
<th>Version</th>
50-
<td id="center">X.Y.Z+k8s-1.XX</td>
51-
<td id="center">X.Y.Z+k8s-1.XX</td>
52-
</tr>
53-
<tr>
54-
<th>Kubernetes Version</th>
55-
<td id="center">1.XX.Y</td>
56-
<td id="center">1.XX.Y</td>
57-
</tr>
58-
<tr>
59-
<th>KOTS Version</th>
60-
<td id="center" colspan="2">1.XXX.Y</td>
61-
</tr>
62-
</table>
63-
-->
64-
65-
${{ steps.release-notes.outputs.release-notes }}
66-
EOF
67-
68-
sed -i -E "/$PATTERN/r /tmp/release-notes.txt" docs/release-notes/rn-embedded-cluster.md
69-
rm -f /tmp/release-notes.txt
29+
- name: Update Release Notes
30+
env:
31+
PATTERN: ".+RELEASE_NOTES_PLACEHOLDER.+"
32+
EC_VERSION: ${{ github.event.inputs.version }}
33+
run: |
34+
# Remove any suffix after the + character to get clean semver
35+
EC_VERSION_CLEAN=${EC_VERSION%%+*}
36+
37+
# Create the full release notes content
38+
cat > /tmp/release-notes.txt << EOF
39+
40+
## ${EC_VERSION_CLEAN}
41+
42+
Released on $(date +'%B %-d, %Y')
43+
44+
<!-- VERSION TABLE PLACEHOLDER
45+
Please manually replace this placeholder with a version table in the format:
46+
47+
<table>
48+
<tr>
49+
<th>Version</th>
50+
<td id="center">X.Y.Z+k8s-1.XX</td>
51+
<td id="center">X.Y.Z+k8s-1.XX</td>
52+
</tr>
53+
<tr>
54+
<th>Kubernetes Version</th>
55+
<td id="center">1.XX.Y</td>
56+
<td id="center">1.XX.Y</td>
57+
</tr>
58+
<tr>
59+
<th>KOTS Version</th>
60+
<td id="center" colspan="2">1.XXX.Y</td>
61+
</tr>
62+
</table>
63+
-->
64+
65+
${{ steps.release-notes.outputs.release-notes }}
66+
EOF
67+
68+
sed -i -E "/$PATTERN/r /tmp/release-notes.txt" docs/release-notes/rn-embedded-cluster.md
69+
rm -f /tmp/release-notes.txt
7070
71-
- name: Create Pull Request
72-
uses: peter-evans/create-pull-request@v7
73-
id: cpr
74-
with:
75-
token: ${{ secrets.REPLICATED_GH_PAT }}
76-
commit-message: Embedded Cluster ${{ github.event.inputs.version }} release notes
77-
title: Embedded Cluster ${{ github.event.inputs.version }} release notes
78-
branch: automation/embedded-cluster-release-notes-${{ github.event.inputs.version }}
79-
delete-branch: true
80-
base: "main"
81-
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."
71+
- name: Create Pull Request
72+
uses: peter-evans/create-pull-request@v7
73+
id: cpr
74+
with:
75+
token: ${{ secrets.REPLICATED_GH_PAT }}
76+
commit-message: Embedded Cluster ${{ github.event.inputs.version }} release notes
77+
title: Embedded Cluster ${{ github.event.inputs.version }} release notes
78+
branch: automation/embedded-cluster-release-notes-${{ github.event.inputs.version }}
79+
delete-branch: true
80+
base: "main"
81+
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."
8282

83-
- name: Check outputs
84-
run: |
85-
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
86-
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
83+
- name: Check outputs
84+
run: |
85+
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
86+
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
8787
88-
- name: Slack Notification
89-
uses: slackapi/[email protected]
90-
with:
91-
webhook: ${{ secrets.EMBEDDED_CLUSTER_RELEASE_NOTES_SLACK_WEBHOOK }}
92-
webhook-type: webhook-trigger
93-
payload: |
94-
"version": "${{ github.event.inputs.version }}",
95-
"pull_request_url": "${{steps.cpr.outputs.pull-request-url}}",
88+
- name: Slack Notification
89+
uses: slackapi/[email protected]
90+
with:
91+
webhook: ${{ secrets.EMBEDDED_CLUSTER_RELEASE_NOTES_SLACK_WEBHOOK }}
92+
webhook-type: webhook-trigger
93+
payload: |
94+
version: "${{ github.event.client_payload.version }}"
95+
pull_request_url: "${{steps.cpr.outputs.pull-request-url}}"

0 commit comments

Comments
 (0)