File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments