Skip to content

Commit 7c47dda

Browse files
committed
Fix GitHub Release note extraction
1 parent e2ae4e4 commit 7c47dda

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ jobs:
228228
version = re.escape(os.environ["RELEASE_VERSION"])
229229
changelog = Path("CHANGELOG.md").read_text(encoding="utf-8")
230230
match = re.search(
231-
rf"^## {version} - .*$\n.*?(?=^## |\Z)",
231+
rf"^## {version} - [^\n]*$\n.*?(?=^## |\Z)",
232232
changelog,
233233
flags=re.MULTILINE | re.DOTALL,
234234
)

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## Unreleased
44

5+
- Stop automated GitHub Release notes at the next changelog heading so a
6+
release contains only its matching version section.
7+
58
## 1.2.1 - 2026-07-21
69

710
- Create or refresh the GitHub Release from the exact verified distributions

tests/test_release_contract.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,7 @@ def test_release_publish_is_tag_bound_and_reuses_one_verified_build() -> None:
711711
assert any("download-artifact" in step.get("uses", "") for step in github_release["steps"])
712712
assert "CHANGELOG.md" in release_job_steps
713713
assert "release-notes.md" in release_job_steps
714+
assert ' - [^\\n]*$\\n.*?(?=^## |\\Z)' in release_job_steps
714715
assert "gh release create" in release_job_steps
715716
assert "gh release edit" in release_job_steps
716717
assert "gh release upload" in release_job_steps

0 commit comments

Comments
 (0)