Skip to content

Commit

Permalink
Update Release tag checking to support v1.10.0 (#1831)
Browse files Browse the repository at this point in the history
\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"
```
  • Loading branch information
wilwade authored Jan 2, 2024
1 parent 530836a commit 14d4388
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: |
version=${{env.NEW_RELEASE_TAG_FROM_UI}}
echo "Release version entered in UI: $version"
regex='^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-rc[1-9]\d*)?$'
regex='^v([0-9]+)\.(0|([1-9][0-9]+))\.(0|([1-9][0-9]+))(-rc[1-9][0-9]*)?$'
if [[ ! $version =~ $regex ]]; then
echo "ERROR: Entered version $version is not valid."
echo "Please use v#.#.#[-rc#] format."
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rococo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: |
version=${{env.TAG_FROM_UI}}
echo "Release version entered in UI: $version"
regex='^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-rc[1-9]\d*)?$'
regex='^v([0-9]+)\.(0|([1-9][0-9]+))\.(0|([1-9][0-9]+))(-rc[1-9][0-9]*)?$'
if [[ ! $version =~ $regex ]]; then
echo "ERROR: Entered version $version is not valid."
echo "Please use v#.#.#[-rc#] format."
Expand Down

0 comments on commit 14d4388

Please sign in to comment.