diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a5317676242..ff9429347402 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,5 @@ ## 1.11.0 (Unreleased) - ENHANCEMENTS: * `init`: Provider installation will utilise credentials configured in a `.netrc` file for the download and shasum URLs returned by provider registries. ([#35843](https://github.com/hashicorp/terraform/issues/35843)) 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