Skip to content

Commit c7f0533

Browse files
committed
Update Publish.yml
1 parent 2f78727 commit c7f0533

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.github/workflows/publish.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,17 @@ jobs:
5050
5151
# Increment versions by the specified input values
5252
new_major=$((major + ${{ github.event.inputs.increment_major }}))
53-
new_minor=$((minor + ${{ github.event.inputs.increment_minor }}))
54-
new_patch=$((patch + ${{ github.event.inputs.increment_patch }}))
53+
if [ ${{ github.event.inputs.increment_major }} -gt 0 ]; then
54+
new_minor="${{ github.event.inputs.increment_minor }}"
55+
new_patch="${{ github.event.inputs.increment_patch }}"
56+
else
57+
new_minor=$((minor + ${{ github.event.inputs.increment_minor }}))
58+
if [ ${{ github.event.inputs.increment_minor }} -gt 0 ]; then
59+
new_patch="${{ github.event.inputs.increment_patch }}"
60+
else
61+
new_patch=$((patch + ${{ github.event.inputs.increment_patch }}))
62+
fi
63+
fi
5564
5665
# Construct the new version string
5766
new_version="$new_major.$new_minor.$new_patch"

0 commit comments

Comments
 (0)