@@ -135,26 +135,22 @@ jobs:
135135 echo "TEST_NODEIDS=${TEST_NODEIDS}"
136136 # Save PR-selected nodeids for reuse after checkout (if provided)
137137 if [ "${TEST_MODE}" = "selected" ] && [ -n "${TEST_NODEIDS}" ]; then
138- python - <<'PY'
139- import json
140- import os
141-
142- raw = os.environ.get("TEST_NODEIDS", "").strip()
143- nodeids = []
144- if raw and raw != "[]":
145- try:
146- parsed = json.loads(raw)
147- except json.JSONDecodeError:
148- parsed = raw.split()
149- if isinstance(parsed, str):
150- parsed = [parsed]
151- if isinstance(parsed, list):
152- nodeids = [item for item in parsed if isinstance(item, str) and item]
153- with open("/tmp/pr_selected_nodeids.txt", "w", encoding="utf-8") as fh:
154- for nodeid in nodeids:
155- fh.write(f"{nodeid}\n")
156- print(f"Selected nodeids parsed: {len(nodeids)}")
157- PY
138+ python -c 'import json, os
139+ raw = os.environ.get("TEST_NODEIDS", "").strip()
140+ nodeids = []
141+ if raw and raw != "[]" :
142+ try :
143+ parsed = json.loads(raw)
144+ except json.JSONDecodeError :
145+ parsed = raw.split()
146+ if isinstance(parsed, str) :
147+ parsed = [parsed]
148+ if isinstance(parsed, list) :
149+ nodeids = [item for item in parsed if isinstance(item, str) and item]
150+ with open("/tmp/pr_selected_nodeids.txt", "w", encoding="utf-8") as fh :
151+ for nodeid in nodeids :
152+ fh.write(f"{nodeid}\n")
153+ print(f"Selected nodeids parsed : {len(nodeids)}")'
158154 else
159155 : > /tmp/pr_selected_nodeids.txt
160156 fi
0 commit comments