Skip to content

Commit cd417c8

Browse files
committed
CI: run the setup-hardened-python guard with shell: python
Drop the bash -c wrapper and its quoting constraints, and fail if PATH does not resolve python to the venv interpreter that later steps use.
1 parent a50fe7f commit cd417c8

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎.github/actions/setup-hardened-python/action.yml‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,19 @@ runs:
8585
} >> "${GITHUB_OUTPUT}"
8686
8787
- name: Check Python interpreter is patched (CVE-2026-115557)
88-
shell: bash --noprofile --norc -euo pipefail {0}
88+
# Runs the venv's python through the PATH entry added above.
89+
shell: python {0}
8990
env:
9091
PYTHON: ${{ steps.venv.outputs.python-path }}
9192
run: |
92-
"${PYTHON}" -c '
93+
import os
9394
import platform
9495
import sys
9596
97+
if os.path.normcase(sys.executable) != os.path.normcase(os.environ["PYTHON"]):
98+
print(f"::error::PATH resolves python to {sys.executable}, not the venv interpreter {os.environ['PYTHON']}.")
99+
sys.exit(1)
100+
96101
FIXED = {(3, 11): 18, (3, 12): 16, (3, 13): 18, (3, 14): 10, (3, 15): 2}
97102
v = sys.version_info
98103
series = (v.major, v.minor)
@@ -110,7 +115,6 @@ runs:
110115
else:
111116
print(f"::error::Python {name} has no release whose ssl module rejects the compromised eMudhra CA keys (CVE-2026-115557).")
112117
sys.exit(1)
113-
'
114118
115119
- name: Update pip
116120
shell: bash --noprofile --norc -xeuo pipefail {0}

0 commit comments

Comments
 (0)