Skip to content

Commit 790180e

Browse files
fix: validate action input edge case
1 parent 2135c4b commit 790180e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ jobs:
176176
set -x
177177
178178
if [[ "${{ steps.test-installation.outcome }}" == "success" ]]; then
179-
echo "error: The action should have failed because both python-version and python-version-file were not given"
179+
echo "error: The action should have failed because both python-version and python-version-file were not given but it has suceeded."
180180
exit 1
181181
else
182182
echo "success: The action successfully failed because both python-version and python-version-file were not given"

find-desired-python-version.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,9 @@ if [[ -z "${desired_python_version}" && -f "${specified_version_file}" ]]; then
1111
desired_python_version=$(cat "${specified_version_file}")
1212
fi
1313

14+
if [[ -z "${desired_python_version}" ]]; then
15+
echo "❌ error: Both inputs .python-version and .python-version-file are not given. Kindly provide one of them." >&2
16+
exit 1
17+
fi
18+
1419
echo "${desired_python_version}"

0 commit comments

Comments
 (0)