Skip to content

Commit 7aba738

Browse files
authored
Infra: Improve create release step with regex matching (#2092)
Bash apparently support regex with the `=~` operator, so we can have a more robust check here. This will only accept version strings that are in the format `0.<version>` where `<version>` is a number with 3 or more digits.
1 parent 3e1c94e commit 7aba738

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/new-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ jobs:
1818
steps:
1919
- name: validate version format
2020
run: |
21-
if [[ ! "${{ github.event.inputs.version }}" == *"."* ]]; then
22-
echo "Error: Version must contain a '.'"
21+
if [[ ! "${{ github.event.inputs.version }}" =~ ^0\.[0-9]{3,}$ ]]; then
22+
echo "Error: Version must be in the format 0.XYZ"
2323
exit 1
2424
fi
2525
- name: create release

0 commit comments

Comments
 (0)