Skip to content

Commit 366724f

Browse files
committed
fix patch version number
1 parent 9c4b585 commit 366724f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/release-source.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,20 @@ jobs:
8181
file_minor=$(echo "$file_release_version" | cut -d'.' -f2)
8282
file_patch=$(echo "$file_release_version" | cut -d'.' -f3)
8383
84+
# decrement the patch version by 1 to get the latest stable release version
85+
stable_patch=$((file_patch - 1))
86+
echo "Stable release version: $file_major.$file_minor.$stable_patch"
87+
8488
input_major=$(echo "$input_release_version" | cut -d'.' -f1)
8589
input_minor=$(echo "$input_release_version" | cut -d'.' -f2)
8690
input_patch=$(echo "$input_release_version" | cut -d'.' -f3)
8791
8892
if [ "$input_major" -eq "$file_major" ]; then
8993
if [ "$input_minor" -eq "$file_minor" ]; then
90-
if [ "$input_patch" -ge "$file_patch" ]; then
94+
if [ "$input_patch" -gt "$stable_patch" ]; then
9195
echo "Valid patch version input"
9296
else
93-
echo "Error: Patch version cannot be less than or equal to the current version."
97+
echo "Error: Patch version cannot be less than or equal to the stable release version."
9498
exit 1
9599
fi
96100
elif [ "$input_minor" -gt "$file_minor" ] && [ "$input_patch" -eq 0 ]; then

0 commit comments

Comments
 (0)