Skip to content

Commit

Permalink
fixg
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinjqliu committed Nov 27, 2024
1 parent 73fc831 commit e885d00
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions .github/workflows/python-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,14 @@ jobs:
version="${{ github.event.inputs.version }}"
# Trim whitespace
version="${version// /}"
if [[ -z "$version" ]]; then
echo "Error: Version input cannot be empty"
exit 1
fi
if [[ "$version" == "main" ]]; then
echo "✓ Valid version: main"
elif [[ "$version" =~ ^rc[0-9]+$ ]]; then
echo "✓ Valid version: $version"
echo "Checking if version is 'main' or a valid rc candidate"
# Matches "main" or any string ending with "rc" followed by one or more digits.
if echo "$version" | grep -E -q '^(main|.*rc[0-9]+)$'; then
echo "Valid version: $version"
else
echo "❌ Error: Version must be 'main' or 'rc' followed by a number (e.g., rc1, rc2)"
echo " Received: '$version'"
echo "Invalid version: $version" >&2
exit 1
fi
- uses: actions/checkout@v4
with:
fetch-depth: 0
Expand Down

0 comments on commit e885d00

Please sign in to comment.