-
Notifications
You must be signed in to change notification settings - Fork 25
66 lines (59 loc) · 2.36 KB
/
kubernetes-installer-release-notes.yml
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
name: kubernetes-installer-release-notes
on:
repository_dispatch:
types: [kubernetes-installer-release-notes]
inputs:
version:
description: kURL version
required: true
jobs:
generate-release-notes-pr:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Generate Release Notes
id: release-notes
env:
KURL_VERSION: ${{ github.event.client_payload.version }}
uses: replicatedhq/release-notes-generator@main
with:
owner-repo: replicatedhq/kurl
head: $KURL_VERSION
title: $KURL_VERSION
include-pr-links: false
github-token: ${{ secrets.GITHUB_TOKEN }}
feature-type-labels: type::feature,kurl::type::feature
- name: Update Release Notes
env:
PATTERN: ".+RELEASE_NOTES_PLACEHOLDER.+"
run: |
cat <<EOT >> /tmp/release-notes.txt
${{ steps.release-notes.outputs.release-notes }}
EOT
sed -i -E "/$PATTERN/r /tmp/release-notes.txt" docs/release-notes/rn-kubernetes-installer.md
rm -rf /tmp/release-notes.txt
- name: Create Pull Request # creates a PR if there are differences
uses: peter-evans/create-pull-request@v3
id: cpr
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Kubernetes Installer ${{ github.event.client_payload.version }} release notes
title: Kubernetes Installer ${{ github.event.client_payload.version }} release notes
branch: automation/kubernetes-installer-release-notes-${{ github.event.client_payload.version }}
delete-branch: true
base: "main"
body: "Automated changes by the [kubernetes-installer-release-notes](https://github.com/replicatedhq/replicated-docs/blob/main/.github/workflows/kubernetes-installer-release-notes.yml) 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
uses: slackapi/[email protected]
with:
payload: |
{
"version": "${{ github.event.client_payload.version }}",
"pull_request_url": "${{steps.cpr.outputs.pull-request-url}}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.KURL_RELEASE_NOTES_SLACK_WEBHOOK }}