ryangoree/Parse Semver Ref

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

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Stale
License
None
namedescriptionrequireddefault
refThe github ref to parse (e.g. refs/tags/v1.0.0, refs/tags/pkg@v1.2.3).yes
namedescription
refThe ref that was parsed
matched`"true"` if the ref matched the semver pattern, `"false"` otherwise.
majorThe major version number from the tag (e.g. `1` from `refs/tags/v1.2.3`).
minorThe minor version number from the tag (e.g. `2` from `refs/tags/v1.2.3`).
patchThe patch version number from the tag (e.g. `3` from `refs/tags/v1.2.3`).
prereleaseThe prerelease version from the tag (e.g. `alpha` from `refs/tags/v1.2.3-alpha`).
buildThe build version from the tag (e.g. `build` from `refs/tags/v1.2.3+build`).
nameThe package name from the tag (e.g. `pkg` from `refs/tags/pkg@v1.2.3`).
scopeThe package scope (if any) from the tag (e.g. `org` from `refs/tags/@org/pkg@v1.2.3`).