This is a GitHub Action that can be used to check that the version input is a
valid SemVer version.
It can also be used to check that the version has the expected prefix and/or
suffix.
It can also be instructed to check tags and releases, such that:
- The tag or release with the same name as the
versiondoes not already exist - The
versionis SemVer higher than the highest existing tag or release
| Input | Description | Required | Default Value |
|---|---|---|---|
version |
The version to check | Yes | None |
prefix |
The prefix to check | No | None |
suffix |
The suffix to check | No | None |
check_tags |
Whether to check tags | No | "false" |
check_releases |
Whether to check releases | No | "false" |
token |
The GitHub token needed to check tags or releases | Yes, if check_tags or check_releases is true |
None |
| Output | Description | Value |
|---|---|---|
valid |
Whether the version is valid | true or false |
message |
A message about the result | See below |
- name: Check version
id: check-version
uses: aisrael/check-semver@v1
with:
version: ${{ inputs.version }}- name: Check version
id: check-version
uses: aisrael/check-semver@v1
with:
version: ${{ inputs.version }}
prefix: 'cli-'- name: Check version
id: check-version
uses: aisrael/check-semver@v1
with:
version: ${{ inputs.version }}
check_tags: true
token: ${{ secrets.GITHUB_TOKEN }}Check that the version is not an existing tag or release, and is SemVer higher than the highest existing tag or release
- name: Check version
id: check-version
uses: aisrael/check-semver@v1
with:
version: ${{ inputs.version }}
check_tags: true
check_releases: true
token: ${{ secrets.GITHUB_TOKEN }}| Message |
|---|
| '${version}' is not a valid SemVer |
| '${version}' does not start with prefix '${prefix}' |
| '${version}' does not end with suffix '${suffix}' |
| Tag '${version}' already exists |
| '${version}' is not SemVer higher than existing tag '${highestTag}' |
| Release '${version}' already exists |
| '${version}' is not SemVer higher than existing release '${highestRelease}' |