Skip to content

Commit 76f7a9b

Browse files
committed
fix(changelog): allow empty unreleased on release commits
1 parent f7897a5 commit 76f7a9b

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

.github/scripts/check-unreleased-changelog.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ UNRELEASED_BLOCK=$(awk '
100100
' CHANGELOG.md)
101101

102102
if [[ -z "${UNRELEASED_BLOCK//$'\n'/}" ]]; then
103+
HEAD_SUBJECT="$(git log -1 --pretty=%s)"
104+
if [[ "$HEAD_SUBJECT" =~ ^chore\(release\):\ [0-9]+\.[0-9]+\.[0-9]+$ ]]; then
105+
echo "Changelog gate passed (release commit allows empty ## [Unreleased])."
106+
exit 0
107+
fi
103108
echo "ERROR: ## [Unreleased] section is empty."
104109
exit 1
105110
fi

.github/scripts/release.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ trap 'rm -rf "$tmp_dir"' EXIT
104104
stripped_changelog="${tmp_dir}/changelog-stripped.md"
105105
new_section_file="${tmp_dir}/new-section.md"
106106
updated_changelog="${tmp_dir}/CHANGELOG.md"
107-
post_release_unreleased_bullet="- Initialize post-${version} unreleased section."
108107

109108
awk '
110109
BEGIN { skip = 0 }
@@ -126,13 +125,11 @@ awk '
126125
echo "$compare_link"
127126
} > "$new_section_file"
128127

129-
awk -v section_file="$new_section_file" -v post_bullet="$post_release_unreleased_bullet" '
128+
awk -v section_file="$new_section_file" '
130129
BEGIN { inserted = 0; skip_next_blank = 0 }
131130
$0 == "## [Unreleased]" && inserted == 0 {
132131
print
133132
print ""
134-
print post_bullet
135-
print ""
136133
while ((getline line < section_file) > 0) {
137134
print line
138135
}

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Targeted test suites (when working on specific areas):
4848
- Required format for regular commits:
4949
- add at least one short, single-line bullet under `## [Unreleased]`.
5050
- Scope is strict (no exceptions for docs/process/policy/chore/dependency-only commits).
51+
- Exception: release commits (`chore(release): X.Y.Z`) may leave `## [Unreleased]` empty.
5152
- Local preflight command:
5253
- `make verify-changelog`
5354
- CI enforces this on both PRs and direct pushes to `main`.

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ All notable changes to FScript are documented in this file.
44

55
## [Unreleased]
66

7-
- Initialize post-0.38.2 unreleased section.
7+
- Updated changelog gating and release preparation so release commits can leave `## [Unreleased]` empty without placeholder bullets.
88

99
## [0.38.2]
1010

0 commit comments

Comments
 (0)