Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
hash

GitHub Action

semver-utils

1.0.0

semver-utils

hash

semver-utils

One-stop shop for working with semantic versions in your workflows

Installation

Copy and paste the following snippet into your .yml file.

              

- name: semver-utils

uses: madhead/semver-utils@1.0.0

Learn more about this action in madhead/semver-utils

Choose a version

madhead/semver-utils status

madhead/semver-utils

One-stop shop for working with semantic versions in your GitHub Actions workflows.

Usage

- uses: madhead/semver-utils@latest
  id: version
  with:
    # A version to work with
    version: 1.2.3

    # A version to compare against
    compare-to: 2.1.0
- run: |
    echo "${{ steps.version.outputs.major }}"             # 1
    echo "${{ steps.version.outputs.minor }}"             # 2
    echo "${{ steps.version.outputs.patch }}"             # 3
    echo "${{ steps.version.outputs.comparison-result }}" # <

If any of the inputs (version or compare-to) cannot be parsed, it is just silently ignored. This action tries its best not to fail.