Skip to content
tag

GitHub Action

Parse Semver Ref

v1.0.0 Latest version

Parse Semver Ref

tag

Parse Semver Ref

Parse a github ref (usually a tag) and extract the semver version, optional package scope, and optional package name

Installation

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

              

- name: Parse Semver Ref

uses: ryangoree/[email protected]

Learn more about this action in ryangoree/parse-semver-ref-action

Choose a version

parse-semver-ref-action

This action parses a a GitHub ref (e.g. refs/tags/v1.2.3) and outputs it's components.

Inputs

ref (Required)

The github ref to parse (e.g. refs/tags/v1.0.0, refs/tags/[email protected]).

Outputs

ref

The ref that was parsed.

matched

"true" if the ref matched the semver pattern, "false" otherwise.

major

The major version number from the tag (e.g. 1 from refs/tags/v1.2.3).

minor

The minor version number from the tag (e.g. 2 from refs/tags/v1.2.3).

patch

The patch version number from the tag (e.g. 3 from refs/tags/v1.2.3).

prerelease

The prerelease version from the tag (e.g. alpha from refs/tags/v1.2.3-alpha).

build

The build version from the tag (e.g. build from refs/tags/v1.2.3+build).

name

The package name from the tag (e.g. pkg from refs/tags/[email protected]).

scope

The package scope (if any) from the tag (e.g. org from refs/tags/@org/[email protected]).