Skip to content

Commit b409727

Browse files
committed
Fix dead changelog fallback and use conventional release subject
1 parent ff4070d commit b409727

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

scripts/release.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77
# End to end this:
88
# 1. bumps "version" in package.json,
9-
# 2. commits "Release corbits X.Y.Z" locally (no tag yet -- see step 5),
9+
# 2. commits "chore(release): corbits X.Y.Z" locally (no tag yet -- see step 5),
1010
# 3. cross-compiles standalone binaries (no runtime required) for
1111
# macOS arm64/x64 and Linux x64/arm64 with `bun build --compile`,
1212
# 4. smoke-tests the host-native binary, then packages each target as a
@@ -334,7 +334,7 @@ write_changelog_section() {
334334
# to its header and `/changelog` renders an empty release.
335335
body=$(printf '%s\n' "$body" | sed 's/^## /### /')
336336
tmp=$(mktemp)
337-
first=$(grep -n '^## \[[0-9]' CHANGELOG.md | head -1 | cut -d: -f1)
337+
first=$(grep -n '^## \[[0-9]' CHANGELOG.md | head -1 | cut -d: -f1 || true)
338338
if [ -z "$first" ]; then
339339
cp CHANGELOG.md "$tmp"
340340
printf '\n## [%s] - %s\n\n%s\n' "$VERSION" "$(date -u +%Y-%m-%d)" "$body" >> "$tmp"
@@ -432,7 +432,7 @@ else
432432
git add CHANGELOG.md
433433
info "wrote generated ## [$VERSION] section into CHANGELOG.md"
434434
fi
435-
git commit -q -m "Release $FORMULA $VERSION"
435+
git commit -q -m "chore(release): $FORMULA $VERSION"
436436
info "committed release $VERSION (PR and tag deferred until after build)"
437437
fi
438438

@@ -505,7 +505,7 @@ else
505505
--json number --jq '.[0].number // empty')
506506
if [ -z "$PR_NUM" ]; then
507507
gh pr create --repo "$MAIN_REPO" --head "$RELEASE_BRANCH" --base main \
508-
--title "Release $FORMULA $VERSION" \
508+
--title "chore(release): $FORMULA $VERSION" \
509509
--body "Version bump to $VERSION. Release notes are generated from the pull requests merged since the previous release." >/dev/null
510510
PR_NUM=$(gh pr list --repo "$MAIN_REPO" --head "$RELEASE_BRANCH" --state open \
511511
--json number --jq '.[0].number // empty')

0 commit comments

Comments
 (0)