Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Makes every effort to derive a valid SemVer version from the action's git ref

Notifications You must be signed in to change notification settings

NetChris/derive-git-ref-semver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Parse SemVer versions

Use this action to parse an input string as a SemVer version. Internally, this uses pcre2grep and the official SemVer.org RegEx to match values.

name: Simplistic Example

on: [push]

jobs:
  some-job:
    runs-on: ubuntu-latest
    name: Some job that uses this action
    steps:
      - name: SemVer parse
        id: parse
        uses: NetChris-actions/parse-semver@v1
        with:
          parseValue: 'v1.2.3'
      - name: Output full match
        run: echo ${{ steps.parse.outputs.semVer }}
      - name: Output major
        run: echo ${{ steps.parse.outputs.semVerMajor }}
      - name: Output minor
        run: echo ${{ steps.parse.outputs.semVerMinor }}
      - name: Output patch
        run: echo ${{ steps.parse.outputs.semVerPatch }}
      - name: Output prerelease
        run: echo ${{ steps.parse.outputs.semVerPreRelease }}
      - name: Output buildmetadata
        run: echo ${{ steps.parse.outputs.semVerBuildMetadata }}
      - name: Output majorMinorOnly
        run: echo ${{ steps.parse.outputs.majorMinorOnly }}

About

Makes every effort to derive a valid SemVer version from the action's git ref

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages