Skip to content

Commit e885d00

Browse files
committed
fixg
1 parent 73fc831 commit e885d00

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

.github/workflows/python-release.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)