Skip to content

Commit bb96e13

Browse files
authored
Update Release tag checking to support v1.10.0 (#1831)
\d doesn't work as expected. Using [0-9] instead # Goal The goal of this PR is to fix a release tagging issue Test in bash: ```bash [[ "v1.10.0" =~ ^v([0-9]+)\.(0|([1-9][0-9]+))\.(0|([1-9][0-9]+))(-rc[1-9][0-9]*)?$ ]] && echo "works" [[ "v1.0.0" =~ ^v([0-9]+)\.(0|([1-9][0-9]+))\.(0|([1-9][0-9]+))(-rc[1-9][0-9]*)?$ ]] && echo "works" [[ "v1.01.0" =~ ^v([0-9]+)\.(0|([1-9][0-9]+))\.(0|([1-9][0-9]+))(-rc[1-9][0-9]*)?$ ]] || echo "fails correctly" [[ "v1.1.01" =~ ^v([0-9]+)\.(0|([1-9][0-9]+))\.(0|([1-9][0-9]+))(-rc[1-9][0-9]*)?$ ]] || echo "fails correctly" [[ "v1.1.1-rc0" =~ ^v([0-9]+)\.(0|([1-9][0-9]+))\.(0|([1-9][0-9]+))(-rc[1-9][0-9]*)?$ ]] || echo "fails correctly" ```
1 parent 73ab3ba commit bb96e13

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
run: |
3737
version=${{env.NEW_RELEASE_TAG_FROM_UI}}
3838
echo "Release version entered in UI: $version"
39-
regex='^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-rc[1-9]\d*)?$'
39+
regex='^v([0-9]+)\.(0|([1-9][0-9]+))\.(0|([1-9][0-9]+))(-rc[1-9][0-9]*)?$'
4040
if [[ ! $version =~ $regex ]]; then
4141
echo "ERROR: Entered version $version is not valid."
4242
echo "Please use v#.#.#[-rc#] format."

.github/workflows/rococo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
run: |
2525
version=${{env.TAG_FROM_UI}}
2626
echo "Release version entered in UI: $version"
27-
regex='^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-rc[1-9]\d*)?$'
27+
regex='^v([0-9]+)\.(0|([1-9][0-9]+))\.(0|([1-9][0-9]+))(-rc[1-9][0-9]*)?$'
2828
if [[ ! $version =~ $regex ]]; then
2929
echo "ERROR: Entered version $version is not valid."
3030
echo "Please use v#.#.#[-rc#] format."

0 commit comments

Comments
 (0)