Skip to content

Commit 9035ab2

Browse files
committed
First to use a release tag
1 parent 98b0574 commit 9035ab2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/npm-publish.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,16 @@ jobs:
7070
current_version=$(echo $current_tag | sed -E 's/web-api-v//')
7171
echo "Current version: $current_version"
7272
73-
# If there is no current version, set it to 1.0.0
74-
if [ -n "${{ github.event.inputs.version }}" ]; then
73+
if [ -n "${{ github.event.release.tag_name }}" ]; then
74+
echo "Using version from release tag: ${{ github.event.release.tag_name }}"
75+
new_version="${{ github.event.release.tag_name }}"
76+
elif [ -n "${{ github.event.inputs.version }}" ]; then
77+
echo "Using version from input: ${{ github.event.inputs.version }}"
7578
new_version="${{ github.event.inputs.version }}"
7679
elif [ -z "$current_version" ]; then
7780
new_version="1.0.0"
7881
else
82+
echo "No release tag or input version provided, incrementing patch version."
7983
new_version=$(npx semver $current_version -i patch)
8084
fi
8185

0 commit comments

Comments
 (0)