File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 3434 with :
3535 fetch-depth : 0
3636
37- - name : Setup newer Python
37+ - name : Check for Python >= 3.10
38+ id : check_python
39+ run : |
40+ echo "python_exists=false" >> $GITHUB_OUTPUT
41+ $pythonCommand = Get-Command python -ErrorAction SilentlyContinue
42+ if ($pythonCommand) {
43+ $pythonVersion = python --version 2>&1
44+ $versionPattern = 'Python (\d+)\.(\d+)\.(\d+)'
45+ echo $pythonVersion
46+ if ($pythonVersion -match $versionPattern) {
47+ $major = [int]$matches[1]
48+ $minor = [int]$matches[2]
49+ if ($major -gt 3 -or ($major -eq 3 -and $minor -ge 10)) {
50+ echo "python_exists=true" >> $GITHUB_OUTPUT
51+ }
52+ }
53+ }
54+ shell : pwsh
55+
56+ - name : Setup Python 3.10
57+ if : steps.check_python.outputs.python_exists == 'false'
3858 uses : actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
3959 with :
4060 python-version : " 3.10"
You can’t perform that action at this time.
0 commit comments