From 2c33dcef769008e159694c74c8d026f7cf8a9156 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Thu, 2 Dec 2021 10:30:14 +0100 Subject: [PATCH] .github: Add function for generating changelogs The function only generates the update kind of changelogs. If the update addresses some CVE, it needs to be added manually. The changelog generation happens only if the changelog directory exists. Also make sure it's included in the patches. --- .../coreos-overlay/.github/workflows/common.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh index 79e1fa0d9f..d0fa870462 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh @@ -64,6 +64,19 @@ function regenerate_manifest() { popd || exit } +function generate_update_changelog() { + local NAME="${1}" + local VERSION="${2}" + local URL="${3}" + local UPDATE_NAME="${4}" + + pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit + if [[ -d changelog/updates ]]; then + echo "- ${NAME} ([${VERSION}](${URL}))" > "changelog/updates/$(date '+%Y-%m-%d')-${UPDATE_NAME}-update.md" + fi + popd >/dev/null || exit +} + function generate_patches() { CATEGORY_NAME=$1 PKGNAME_SIMPLE=$2 @@ -78,6 +91,9 @@ function generate_patches() { # We can only create the actual commit in the actual source directory, not under the SDK. # So create a format-patch, and apply to the actual source. git add ${CATEGORY_NAME}/${PKGNAME_SIMPLE} + if [[ -d changelog ]]; then + git add changelog + fi for dir in "$@"; do git add "${dir}" done