Skip to content

Commit ab2fb4d

Browse files
authored
Merge pull request #4 from chrisgreg/fix-release-sh
Fix pattern matching on unreleased changes in changelog.md
2 parents aa5ba58 + 6073b93 commit ab2fb4d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scripts/release.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ if ! grep -q "## \[Unreleased\]" CHANGELOG.md; then
7272
fi
7373

7474
# Check if there are actual changes in [Unreleased]
75-
if grep -A 3 "## \[Unreleased\]" CHANGELOG.md | grep -q "^## \["; then
75+
# Extract content between [Unreleased] and the next version heading
76+
UNRELEASED_CONTENT=$(sed -n '/^## \[Unreleased\]/,/^## \[[0-9]/p' CHANGELOG.md | sed '$d')
77+
if ! echo "$UNRELEASED_CONTENT" | grep -q "^-"; then
7678
echo -e "${RED}Error: [Unreleased] section appears to be empty${NC}"
7779
echo "Please add your changes to the [Unreleased] section first."
7880
exit 1

0 commit comments

Comments
 (0)