This action compares two semver strings using the semver-compare npm package.
Required The left semver to compare.
Required The right semver to compare.
If the semver left-semver
is greater than right-semver
, return 1
. If the semver string right-semver
is greater than left-semver
, return -1
. If left-semver
equals right-semver
, return 0
.
- name: Semver Compare
id: semver_compare
uses: samcarswell/[email protected]
with:
left-semver: ${{ env.LEFT_VERSION }} # You'll probably want to retrieve these inputs from an earlier step
right-semver: ${{ env.RIGHT_VERSION }}
- name: Compare Output
run: |
echo "${{ steps.semver_compare.outputs.compare-value }}"