Skip to content

samcarswell/semver-compare-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

semver-compare-action

This action compares two semver strings using the semver-compare npm package.

Inputs

left-semver

Required The left semver to compare.

right-semver

Required The right semver to compare.

Outputs

compare-value

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.

Example usage

- 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 }}"

About

Action to compare two semvers

Resources

Stars

Watchers

Forks

Packages

No packages published