Skip to content

Commit 584f3ae

Browse files
committed
[MOB-10788] - Pre Release Automation
Fixing grep search failure
1 parent ad6ada2 commit 584f3ae

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/prepare-for-release.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ jobs:
4242
exit 1
4343
fi
4444
45-
# Get the current version
46-
current_version=$(grep -oP "^## \[\K[0-9]+\.[0-9]+\.[0-9]+(?:-[a-zA-Z0-9]+)?(?=\])" "$changelog_file" | head -n1)
45+
# Get the current version - using awk
46+
current_version=$(awk '/^## \[[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?\]/ { match($0, /[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?/); print substr($0, RSTART, RLENGTH); exit }' "$changelog_file")
4747
new_version="${{ github.event.inputs.version }}"
4848
4949
# Validate version format
@@ -64,8 +64,8 @@ jobs:
6464
echo "## [Unreleased]"
6565
echo ""
6666
echo "## [$new_version]"
67-
# Remove the "## [Unreleased]" line from unreleased_content if it exists
68-
echo "$unreleased_content" | sed '1{/^## \[Unreleased\]/d}'
67+
# Remove the "## [Unreleased]" line from unreleased_content using BSD sed
68+
echo "$unreleased_content" | sed '1{/^## \[Unreleased\]/d;}'
6969
echo ""
7070
# Get the rest of the file starting from the first version entry
7171
sed -n '/^## \[[0-9]/,$p' "$changelog_file"

0 commit comments

Comments
 (0)