Skip to content

Commit

Permalink
[MOB-10788] - Pre Release Automation
Browse files Browse the repository at this point in the history
Fixing grep search failure
  • Loading branch information
Ayyanchira committed Feb 4, 2025
1 parent ad6ada2 commit 584f3ae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/prepare-for-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ jobs:
exit 1
fi
# Get the current version
current_version=$(grep -oP "^## \[\K[0-9]+\.[0-9]+\.[0-9]+(?:-[a-zA-Z0-9]+)?(?=\])" "$changelog_file" | head -n1)
# Get the current version - using awk
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")
new_version="${{ github.event.inputs.version }}"
# Validate version format
Expand All @@ -64,8 +64,8 @@ jobs:
echo "## [Unreleased]"
echo ""
echo "## [$new_version]"
# Remove the "## [Unreleased]" line from unreleased_content if it exists
echo "$unreleased_content" | sed '1{/^## \[Unreleased\]/d}'
# Remove the "## [Unreleased]" line from unreleased_content using BSD sed
echo "$unreleased_content" | sed '1{/^## \[Unreleased\]/d;}'
echo ""
# Get the rest of the file starting from the first version entry
sed -n '/^## \[[0-9]/,$p' "$changelog_file"
Expand Down

0 comments on commit 584f3ae

Please sign in to comment.