fix: release script preflight allows pre-written RELEASE_NOTES.md

CLAUDE.md's release-notes convention says "write them to
releases/v<version>/RELEASE_NOTES.md BEFORE running the script" — but
the script's git-clean preflight rejected any working-tree state
including that exact file as untracked. Chicken-and-egg: you couldn't
follow the documented flow.

Preflight now whitelists releases/v<VERSION>/RELEASE_NOTES.md as the one
allowed untracked path. Everything else still fails the check.

Caught while running v1.6.2.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Alan Wizemann
2026-04-17 17:17:49 -07:00
parent eed55cbb0f
commit 73b44202ba
+8 -2
View File
@@ -74,8 +74,14 @@ require_cmd gh
cd "$REPO_ROOT" cd "$REPO_ROOT"
# git must be clean and on main # git must be clean and on main. The one exception: the release dir
if [[ -n "$(git status --porcelain)" ]]; then # (releases/v<VERSION>/) may already exist and be untracked — the user may
# have written RELEASE_NOTES.md there ahead of time, and the rest of the dir
# is auto-populated + gitignored anyway. Git status abbreviates to the dir
# path when all contents are untracked, so the whitelist matches both forms.
ALLOW="^\?\? releases/v${VERSION}/"
DIRTY="$(git status --porcelain | grep -Ev "$ALLOW" || true)"
if [[ -n "$DIRTY" ]]; then
die "working tree not clean — commit or stash first" die "working tree not clean — commit or stash first"
fi fi
CUR_BRANCH="$(git rev-parse --abbrev-ref HEAD)" CUR_BRANCH="$(git rev-parse --abbrev-ref HEAD)"