Skip to content

Commit 03eaaff

Browse files
committed
Remove action an just use shell commands
1 parent 268f1b9 commit 03eaaff

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

.github/workflows/version-check.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,19 @@ jobs:
4242
echo "package_version=$PACKAGE_VERSION" >> $GITHUB_OUTPUT
4343
4444
- name: Compare versions
45-
uses: jackbilestech/semver-compare@1.0.4
46-
with:
47-
head: '${{ steps.get_version.outputs.package_version }}'
48-
base: '${{ steps.get_tag.outputs.latest_tag }}'
49-
operator: '>='
45+
run: |
46+
LATEST_TAG="${{ steps.get_tag.outputs.latest_tag }}"
47+
PACKAGE_VERSION="${{ steps.get_version.outputs.package_version }}"
48+
# Semvar sorting (-V) and checking which comes last
49+
LATEST=$(printf "%s\n%s" "$LATEST_TAG" "$PACKAGE_VERSION" | sort -V | tail -n1)
50+
51+
if [ "$LATEST" == "$PACKAGE_VERSION" ]; then
52+
echo "✅ package.json version ($PACKAGE_VERSION) is newer or equal to latest tag ($LATEST_TAG)"
53+
else
54+
echo "❌ Version mismatch!"
55+
echo " package.json version: $PACKAGE_VERSION"
56+
echo " Latest git tag: $LATEST_TAG"
57+
echo ""
58+
echo "Please update package.json version to match the tag or create a new tag."
59+
exit 1
60+
fi

0 commit comments

Comments
 (0)