mirror of
https://github.com/awizemann/scarf.git
synced 2026-05-10 02:26:37 +00:00
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:
+8
-2
@@ -74,8 +74,14 @@ require_cmd gh
|
||||
|
||||
cd "$REPO_ROOT"
|
||||
|
||||
# git must be clean and on main
|
||||
if [[ -n "$(git status --porcelain)" ]]; then
|
||||
# git must be clean and on main. The one exception: the release dir
|
||||
# (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"
|
||||
fi
|
||||
CUR_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
|
||||
|
||||
Reference in New Issue
Block a user