Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/apexskier/github-semver-parse
GitHub Action to parse semver strings
https://github.com/apexskier/github-semver-parse
Last synced: 6 days ago
JSON representation
GitHub Action to parse semver strings
- Host: GitHub
- URL: https://github.com/apexskier/github-semver-parse
- Owner: apexskier
- Created: 2020-10-10T09:48:26.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-28T01:51:12.000Z (16 days ago)
- Last Synced: 2024-10-28T05:43:55.217Z (16 days ago)
- Language: TypeScript
- Size: 891 KB
- Stars: 2
- Watchers: 4
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# Semver Parse
This GitHub Action parses semver strings.
## Outputs
**major**: The major version component.
**minor**: The minor version component.
**patch**: The patch version component.
**prerelease**: The merged prerelease component of the version.
**build**: The merged build component of the version.
**version**: The parsed, validated semver string. Empty if not valid.
## Example
```yml
name: Tag creationon:
push:
tags:
- v*jobs:
release:
runs-on: ubuntu-lateststeps:
- uses: actions/checkout@v4- name: Get the version
id: version
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
shell: bash- uses: apexskier/github-semver-parse@v1
id: semver
with:
version: ${{ steps.version.outputs.VERSION }}- name: Release
uses: softprops/action-gh-release@v1
env:
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
# must use a separate token, not the built-in one to trigger subsequent builds
GITHUB_TOKEN: ${{ secrets.RELEASE_GH_TOKEN }}
with:
tag_name: ${{ steps.version.outputs.VERSION }}
prerelease: ${{ !!steps.semver.outputs.prerelease }}
```## Versions
Workflows will automatically update the tags `v1` and `latest`, allowing you to reference one of those instead of locking to a specific release.