Skip to content

Commit 0a1f24e

Browse files
committed
use github action eval
1 parent e885d00 commit 0a1f24e

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

.github/workflows/python-release.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,15 @@ jobs:
3737
os: [ ubuntu-22.04, windows-2022, macos-13, macos-14, macos-15 ]
3838

3939
steps:
40-
- name: Validate version input
41-
run: |
42-
version="${{ github.event.inputs.version }}"
43-
# Trim whitespace
44-
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"
49-
else
50-
echo "Invalid version: $version" >&2
51-
exit 1
52-
fi
40+
- name: Validate version input
41+
if: ${{ github.event.inputs.version != 'main' && !contains(github.event.inputs.version, 'rc') }}
42+
run: |
43+
echo "Error: Invalid version format. You provided: '${{ github.event.inputs.version }}'"
44+
echo "Allowed formats:"
45+
echo " - 'main'"
46+
echo " - version string containing 'rc' (e.g., 0.8.0rc1, 0.8.0rc2)"
47+
exit 1
48+
5349
- uses: actions/checkout@v4
5450
with:
5551
fetch-depth: 0

0 commit comments

Comments
 (0)