Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/netchris/derive-git-ref-semver
Makes every effort to derive a valid SemVer version from the action's git ref
https://github.com/netchris/derive-git-ref-semver
github-actions
Last synced: about 1 month ago
JSON representation
Makes every effort to derive a valid SemVer version from the action's git ref
- Host: GitHub
- URL: https://github.com/netchris/derive-git-ref-semver
- Owner: NetChris
- Created: 2024-01-19T02:47:50.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-01-19T06:21:25.000Z (11 months ago)
- Last Synced: 2024-01-20T04:33:13.318Z (11 months ago)
- Topics: github-actions
- Language: Shell
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Parse SemVer versions
Use this action to parse an input string as a SemVer version. Internally, this uses [`pcre2grep`](https://www.pcre.org/current/doc/html/pcre2grep.html) and [the official SemVer.org RegEx](https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string) to match values.
``` yml
name: Simplistic Exampleon: [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 }}
```