Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 39 additions & 34 deletions .github/scripts/update-changelog.sh
Original file line number Diff line number Diff line change
@@ -1,45 +1,50 @@
#!/usr/bin/env bash
# Update CHANGELOG.md with release notes for a given version.
# Update CHANGELOG.md in the current directory with release notes for a
# given version.
# Usage: update-changelog.sh <version> <notes-file>
# Replaces [Unreleased] section if present, otherwise inserts after header.
# The entry goes above the newest version entry, replacing an [Unreleased]
# section if there is one.

set -euo pipefail

VERSION="${1:?Usage: update-changelog.sh <version> <notes-file>}"
NOTES_FILE="${2:?Usage: update-changelog.sh <version> <notes-file>}"

NOTES=$(cat "$NOTES_FILE")
DATE=$(date +%Y-%m-%d)

python3 - "$VERSION" "$DATE" "$NOTES" << 'PYTHON'
import sys, re, os

version, date, notes = sys.argv[1], sys.argv[2], sys.argv[3]
entry = f"## [{version}] — {date}\n\n{notes}"

changelog_path = "CHANGELOG.md"
if os.path.exists(changelog_path):
with open(changelog_path) as f:
text = f.read()
# Replace [Unreleased] section if present
if re.search(r'^## \[Unreleased\]', text, re.MULTILINE):
text = re.sub(
r'## \[Unreleased\].*?(?=\n## \[|$)',
entry,
text, count=1, flags=re.DOTALL
)
else:
# Insert before the first version entry (## [x.y.z])
lines = text.split('\n')
insert_at = next(
(i for i in range(len(lines)) if lines[i].startswith('## [')),
len(lines)
)
lines.insert(insert_at, f"\n{entry}\n")
text = '\n'.join(lines)
else:
text = f"# Changelog\n\n{entry}\n"

with open(changelog_path, 'w') as f:
f.write(text)
# Python reads this program from fd 3, not stdin, so a notes file of
# /dev/stdin still reads the caller's stdin.
python3 /dev/fd/3 "$VERSION" "$DATE" "$NOTES_FILE" 3<< 'PYTHON'
import sys, re
from pathlib import Path

# From an "## [Unreleased]" heading up to the next "## [" heading or the end
# of the file, the section's trailing blank lines included.
UNRELEASED_SECTION = re.compile(
r'^## \[Unreleased\].*?(?=^## \[|\Z)', re.DOTALL | re.MULTILINE
)
# An entry heading: any line starting "## [".
ENTRY_HEADING = re.compile(r'^## \[', re.MULTILINE)

version, date, notes_file = sys.argv[1:]
notes = Path(notes_file).read_text(encoding="utf-8")

changelog = Path("CHANGELOG.md")
text = changelog.read_text(encoding="utf-8") if changelog.exists() else ""
# Remove an [Unreleased] section rather than replace it with the entry:
# re.sub reads backslashes in a replacement string as escapes.
text = UNRELEASED_SECTION.sub('', text, count=1)

first_entry = ENTRY_HEADING.search(text)
header_end = first_entry.start() if first_entry else len(text)

# With no text above the first entry, the header is a "# Changelog" title.
header = text[:header_end].rstrip() or "# Changelog"
entry = f"## [{version}] — {date}\n\n{notes}".rstrip()
earlier_entries = text[header_end:].rstrip()

# Every part is rstripped, so the join leaves exactly one blank line between
# parts and a single newline at the end of the file.
parts = [header, entry, earlier_entries]
changelog.write_text("\n\n".join(part for part in parts if part) + "\n", encoding="utf-8")
Comment thread
aliasunder marked this conversation as resolved.
PYTHON
142 changes: 0 additions & 142 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,126 +1,5 @@
# Changelog


























































































































## [0.54.16] — 2026-10-20

### Features
Expand Down Expand Up @@ -2794,14 +2673,12 @@

- Update CHANGELOG.md for v0.12.1


## [0.12.1] — 2026-05-18

### Bug Fixes

- Prevent port 8000 wipe by avoiding ForceNew on InstancePublicPorts (#42)


## [0.12.0] — 2026-05-18

### Features
Expand All @@ -2812,7 +2689,6 @@

- Remove unneeded type


## [0.11.3] — 2026-05-17

### Features
Expand All @@ -2827,7 +2703,6 @@

- Add gitleaks secret scanning (#38)


## [0.11.2] — 2026-05-16

### Documentation
Expand All @@ -2839,14 +2714,12 @@

- Align Node references on Node 24 and fix doc inaccuracies (#37)


## [0.11.1] — 2026-05-16

### Bug Fixes

- Env-var import — default import, not namespace (#35)


## [0.11.0] — 2026-05-16

### Bug Fixes
Expand All @@ -2858,7 +2731,6 @@
- README rewrite and deployment docs for open-source (#33)
- Update CHANGELOG.md for v0.10.0


## [0.10.0] — 2026-05-16

### Features
Expand All @@ -2870,7 +2742,6 @@

- Update CHANGELOG.md for v0.9.0


## [0.9.0] — 2026-05-16

### Bug Fixes
Expand All @@ -2886,15 +2757,13 @@

- **deps:** Update all dependencies, Node 24, TypeScript 6 (#27)


## [0.8.1] — 2026-05-15

### Documentation

- Improve tool descriptions for structural edit safety (#23)
- Update CHANGELOG.md for v0.8.0


## [0.8.0] — 2026-05-15

### Features
Expand All @@ -2906,12 +2775,10 @@
- Document sort order in search-by-tag/folder/property tool descriptions
- Update CHANGELOG.md for v0.7.0


## [0.7.0] — 2026-05-14

No notable changes.


## [0.6.4] — 2026-05-14

### Features
Expand All @@ -2922,7 +2789,6 @@ No notable changes.

- Update CHANGELOG.md for v0.6.3


## [0.6.3] — 2026-05-14

### Refactoring
Expand All @@ -2934,7 +2800,6 @@ No notable changes.

- Update CHANGELOG.md for v0.6.2


## [0.6.2] — 2026-05-14

### Bug Fixes
Expand All @@ -2945,7 +2810,6 @@ No notable changes.

- Update CHANGELOG.md for v0.6.1


## [0.6.1] — 2026-05-14

### Bug Fixes
Expand All @@ -2960,7 +2824,6 @@ No notable changes.

- Update .gitignore


## [0.6.0] — 2026-05-13

### Features
Expand All @@ -2971,7 +2834,6 @@ No notable changes.

- Update CHANGELOG.md for v0.5.0


## [0.5.0] — 2026-05-13

### Features
Expand All @@ -2994,7 +2856,6 @@ No notable changes.

- **vault-mcp:** Cover server.ts helpers and mcp-router.ts (#14)


## [0.4.0] — 2026-05-13

### Features
Expand All @@ -3009,7 +2870,6 @@ No notable changes.

- Update CHANGELOG.md for v0.3.0


## [0.3.0] — 2026-05-12

### Features
Expand All @@ -3020,7 +2880,6 @@ No notable changes.

- Update CHANGELOG.md for v0.2.0


## [0.2.0] — 2026-05-11

### Features
Expand All @@ -3038,7 +2897,6 @@ No notable changes.

- **ci:** Inline deploy + release in manual_release so the chain fires (#6)


## [0.1.1] — 2026-05-11

Initial tagged release — Phase 1 scaffold and core implementation.
Expand Down
Loading
Loading