File tree Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -42,22 +42,14 @@ jobs:
4242 version="${{ github.event.inputs.version }}"
4343 # Trim whitespace
4444 version="${version// /}"
45-
46- if [[ -z "$version" ]]; then
47- echo "Error: Version input cannot be empty"
48- exit 1
49- fi
50-
51- if [[ "$version" == "main" ]]; then
52- echo "✓ Valid version: main"
53- elif [[ "$version" =~ ^rc[0-9]+$ ]]; then
54- echo "✓ Valid version: $version"
45+ echo "Checking if version is 'main' or a valid rc candidate"
46+ # Matches "main" or any string ending with "rc" followed by one or more digits.
47+ if echo "$version" | grep -E -q '^(main|.*rc[0-9]+)$'; then
48+ echo "Valid version: $version"
5549 else
56- echo "❌ Error: Version must be 'main' or 'rc' followed by a number (e.g., rc1, rc2)"
57- echo " Received: '$version'"
50+ echo "Invalid version: $version" >&2
5851 exit 1
5952 fi
60-
6153 - uses : actions/checkout@v4
6254 with :
6355 fetch-depth : 0
You can’t perform that action at this time.
0 commit comments