-
Notifications
You must be signed in to change notification settings - Fork 4
53 lines (47 loc) · 2.23 KB
/
update-release-notes.yaml
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
name: auto-release-notes
on:
repository_dispatch:
types: [auto-release-notes]
jobs:
build-pr-release-notes:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Create Release Notes Template
id: release-notes
env:
KURL_VERSION: ${{ github.event.client_payload.version }}
run: |
KURL_VERSION=$( echo $KURL_VERSION | sed -E -e 's/v(.*)/\1/g' )
echo "parsed_kurl_version=$KURL_VERSION" >> "$GITHUB_OUTPUT"
cp ./hack/release-notes.md.tmpl ./src/release-notes/${KURL_VERSION}.md
DATE=$(date +%F)
WEIGHT=$(echo $KURL_VERSION | tr -d "v\.\-")
sed -i "s/__DATE__/$DATE/g" ./content/release-notes/${KURL_VERSION}.md
sed -i "s/__VERSION__/$KURL_VERSION/g" ./content/release-notes/${KURL_VERSION}.md
- name: Create Pull Request # creates a PR if there are differences
uses: peter-evans/create-pull-request@v7
id: cpr
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: draft release notes kurl ${{ github.event.client_payload.version }}
title: '[${{ github.event.client_payload.version }}] Triggered Release Notes'
branch: automation/release-notes-${{ steps.release-notes.outputs.parsed_kurl_version }}-${{github.run_id}} # Create a unique branch to prevent overwrites on re-tag
delete-branch: true
labels: |
release-notes
automated
draft: true
base: "main"
body: "Automated changes by the [auto-release-notes](https://github.com/replicatedhq/kurl.sh/blob/main/.github/workflows/update-release-notes.yaml) GitHub action"
- 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
id: slack
uses: slackapi/[email protected]
with:
payload: "{\"message\":\"Pull request #${{steps.cpr.outputs.pull-request-number }} is ready for kURL.sh release notes: ${{steps.cpr.outputs.pull-request-url}}\",\"version\":\"${{ steps.release-notes.outputs.parsed_kurl_version }}\"}"
env:
SLACK_WEBHOOK_URL: ${{ secrets.KOTS_RELEASE_SLACK_WEBHOOK }}