diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a37a21b2063..0722a155b85a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 1.10.3 (Unreleased) +## 1.10.4 (Unreleased) BUG FIXES: diff --git a/scripts/changelog.sh b/scripts/changelog.sh index 28cc4b1ea6b0..43a8f3654dcf 100755 --- a/scripts/changelog.sh +++ b/scripts/changelog.sh @@ -6,6 +6,7 @@ set -uo pipefail CHANGIE_VERSION="${CHANGIE_VERSION:-1.21.0}" +SEMVER_VERSION="${SEMVER_VERSION:-7.6.3}" function usage { cat <<-'EOF' @@ -45,6 +46,11 @@ function generate { LATEST_VERSION=$(npx -y changie@$CHANGIE_VERSION latest -r --skip-prereleases) COMPLETE_VERSION="$LATEST_VERSION-dev" + # Check if we already released this version already + if git tag -l "v$LATEST_VERSION" | grep -q "v$LATEST_VERSION"; then + LATEST_VERSION=$(npx -y semver@$SEMVER_VERSION -i patch $LATEST_VERSION) + fi + npx -y changie@$CHANGIE_VERSION merge -u "## $LATEST_VERSION (Unreleased)" # If we have no changes yet, the changelog is empty now, so we need to add a header