We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 018b8aa commit c1fb98aCopy full SHA for c1fb98a
1 file changed
.github/workflows/test.yml
@@ -35,7 +35,12 @@ jobs:
35
- name: Get Python version from pre-commit config
36
id: python-version
37
run: |
38
- version=$(grep -E "python:|language_version:" .pre-commit-config.yaml | head -1 | sed -E 's/.*python:|.*language_version://g' | tr -d ' "'"'"'')
+ 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"
44
echo "version=$version" >> $GITHUB_OUTPUT
45
- name: Set up Python
46
uses: actions/setup-python@v5
0 commit comments