Skip to content

Commit

Permalink
Update regex for version validation
Browse files Browse the repository at this point in the history
  • Loading branch information
skobow committed May 17, 2024
1 parent 18204c8 commit 9ae030c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/gradle-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:

- name: Validate versions
run: |
VERSION_REGEX="^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\+[0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*)?$"
VERSION_REGEX="^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$"
echo "Checking if version and nextVersion comply with semantic versioning..."
if [[ ! "${{ github.event.inputs.version }}" =~ $VERSION_REGEX ]] || [[ ! "${{ github.event.inputs.nextVersion }}" =~ $VERSION_REGEX ]]; then
Expand Down

0 comments on commit 9ae030c

Please sign in to comment.