Skip to content

Commit dfe17b1

Browse files
fix: Handle pinned sha versions of Python in the install_requirements action (#268)
When PYTHON_VERSION is pinned to a specific sha (as done by Renovate best-practices), install_requirements fails as the container tag is not a valid version of python when including the sha. This trims the trailing part of the tag to just the [0-9\.]+ part which should be the valid python version.
1 parent 2000007 commit dfe17b1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.github/actions/install_requirements/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ runs:
1515
run: |
1616
PYTHON_VERSION="${{ inputs.python-version }}"
1717
if [ $PYTHON_VERSION == "dev" ]; then
18-
PYTHON_VERSION=$(sed -n "s/ARG PYTHON_VERSION=//p" Dockerfile)
18+
# python version from Dockerfile, removing potential pinned sha
19+
PYTHON_VERSION=$(sed -Ene "s/ARG PYTHON_VERSION=([0-9\.]+).*/\1/p" Dockerfile)
1920
fi
2021
echo "PYTHON_VERSION=$PYTHON_VERSION" >> "$GITHUB_ENV"
2122
shell: bash

0 commit comments

Comments
 (0)