Skip to content

Commit c1fb98a

Browse files
committed
try to solve cache miss
1 parent 018b8aa commit c1fb98a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/test.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ jobs:
3535
- name: Get Python version from pre-commit config
3636
id: python-version
3737
run: |
38-
version=$(grep -E "python:|language_version:" .pre-commit-config.yaml | head -1 | sed -E 's/.*python:|.*language_version://g' | tr -d ' "'"'"'')
38+
if [ -f .pre-commit-config.yaml ]; then
39+
version=$(yq eval '.default_language_version.python // .repos[].hooks[].language_version // "3.11"' .pre-commit-config.yaml | head -1)
40+
else
41+
version="3.11"
42+
fi
43+
echo "Detected Python version: $version"
3944
echo "version=$version" >> $GITHUB_OUTPUT
4045
- name: Set up Python
4146
uses: actions/setup-python@v5

0 commit comments

Comments
 (0)