Skip to content

Commit 6800277

Browse files
fix: read version from python-version-file only if python-version is unset
1 parent 4cde2b7 commit 6800277

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: 'Setup python amazon linux'
22
description: 'setup-python action for amazon linux self hosted runners'
33
inputs:
44
python-version:
5-
description: 'Version of python to be installed. Reads from .python-version if unset.'
5+
description: 'Version of python to be installed. Reads from python-version-file if unset.'
66
python-version-file:
77
description: 'Version of python to be installed'
88
default: '.python-version'

find-desired-python-version.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ specified_version="$1"
66
specified_version_file="$2"
77

88
desired_python_version="${specified_version}"
9-
if [ -f "${specified_version_file}" ]; then
9+
10+
if [[ -z "${desired_python_version}" && -f "${specified_version_file}" ]]; then
1011
desired_python_version=$(cat "${specified_version_file}")
1112
fi
1213

0 commit comments

Comments
 (0)