Skip to content

replicated-sdk-release-notes #22

replicated-sdk-release-notes

replicated-sdk-release-notes #22

name: replicated-sdk-release-notes
on:
repository_dispatch:
types: [replicated-sdk-release-notes]
inputs:
version:
description: Replicated SDK version
required: true
prev_version:
description: Previous Replicated SDK version
required: true
jobs:
generate-release-notes-pr:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Generate Release Notes
id: release-notes
env:
REPLICATED_SDK_VERSION: ${{ github.event.client_payload.version }}
PREV_REPLICATED_SDK_VERSION: ${{ github.event.client_payload.prev_version }}
uses: replicatedhq/release-notes-generator@main
with:
owner-repo: replicatedhq/replicated-sdk
base: v$PREV_REPLICATED_SDK_VERSION
head: v$REPLICATED_SDK_VERSION
title: $REPLICATED_SDK_VERSION
include-pr-links: false
github-token: ${{ secrets.GITHUB_TOKEN }}
- 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-replicated-sdk.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: Replicated SDK ${{ github.event.client_payload.version }} release notes
title: Replicated SDK ${{ github.event.client_payload.version }} release notes
branch: automation/replicated-sdk-release-notes-${{ github.event.client_payload.version }}
delete-branch: true
base: "main"
body: "Automated changes by the [replicated-sdk-release-notes](https://github.com/replicatedhq/replicated-docs/blob/main/.github/workflows/replicated-sdk-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.REPLICATED_SDK_RELEASE_NOTES_SLACK_WEBHOOK }}