Skip to content

Commit 5289b0c

Browse files
ensure changelog script can handle empty alpha releases
1 parent 21fcc62 commit 5289b0c

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 1.14.0-alpha20250716
2+
3+
14
EXPERIMENTS:
25

36
Experiments are only enabled in alpha releases of Terraform CLI. The following features are not yet available in stable releases.

scripts/changelog.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,14 @@ function generate {
7979
COMPLETE_VERSION="$LATEST_VERSION-$PRERELEASE_VERSION"
8080

8181
npx -y changie@$CHANGIE_VERSION merge -u "## $COMPLETE_VERSION ($HUMAN_DATE)"
82+
83+
# If we have no changes yet, the changelog is empty now, so we need to add a header
84+
if ! grep -q "$COMPLETE_VERSION" CHANGELOG.md; then
85+
CURRENT_CHANGELOG=$(cat CHANGELOG.md)
86+
echo "## $COMPLETE_VERSION" > CHANGELOG.md
87+
echo "" >> CHANGELOG.md
88+
echo "$CURRENT_CHANGELOG" >> CHANGELOG.md
89+
fi
8290
;;
8391

8492
beta)

0 commit comments

Comments
 (0)