From c7bb972cce43ec9e1c617cba6a07462ba31b79e9 Mon Sep 17 00:00:00 2001 From: Michelle Au Date: Fri, 22 Dec 2023 01:05:07 +0000 Subject: [PATCH] Fix release notes script to use fixed tags --- ...ase_notes.sh => generate-patch-release-notes.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) rename generate_patch_release_notes.sh => generate-patch-release-notes.sh (87%) diff --git a/generate_patch_release_notes.sh b/generate-patch-release-notes.sh similarity index 87% rename from generate_patch_release_notes.sh rename to generate-patch-release-notes.sh index 606c24d22..2b9c13c38 100755 --- a/generate_patch_release_notes.sh +++ b/generate-patch-release-notes.sh @@ -48,7 +48,7 @@ function gen_patch_relnotes() { rm out.md || true rm -rf /tmp/k8s-repo || true GITHUB_TOKEN="$CSI_RELEASE_TOKEN" \ - release-notes --discover=patch-to-latest --branch="$2" \ + release-notes --start-rev="$3" --end-rev="$2" --branch="$2" \ --org=kubernetes-csi --repo="$1" \ --required-author="" --markdown-links --output out.md } @@ -57,11 +57,14 @@ for rel in "${releases[@]}"; do read -r repo version <<< "$rel" # Parse minor version - minorPattern="(^[[:digit:]]+\.[[:digit:]]+)\." - [[ "$version" =~ $minorPattern ]] + minorPatchPattern="(^[[:digit:]]+\.[[:digit:]]+)\.([[:digit:]]+)" + [[ "$version" =~ $minorPatchPattern ]] minor="${BASH_REMATCH[1]}" + patch="${BASH_REMATCH[2]}" - echo "$repo" "$version" "$minor" + echo "$repo $version $minor $patch" + prevPatch="$((patch-1))" + prevVer="v$minor.$prevPatch" pushd "$repo/CHANGELOG" @@ -74,7 +77,7 @@ for rel in "${releases[@]}"; do git checkout --track "upstream/release-$minor" -b "$branch" # Generate release notes - gen_patch_relnotes "$repo" "release-$minor" + gen_patch_relnotes "$repo" "release-$minor" "$prevVer" cat > tmp.md <> tmp.md echo >> tmp.md + rm out.md file="CHANGELOG-$minor.md" cat "$file" >> tmp.md