Skip to content

Commit c673163

Browse files
authored
CI: fix workflow run block for nodeid parser (#565)
1 parent e92fe33 commit c673163

1 file changed

Lines changed: 1 addition & 16 deletions

File tree

.github/workflows/build-ultraplot.yml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -135,22 +135,7 @@ 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 -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)}")'
138+
python -c 'import json,os; raw=os.environ.get("TEST_NODEIDS","").strip(); parsed=json.loads(raw) if raw and raw!="[]" else []; parsed=[parsed] if isinstance(parsed,str) else parsed; nodeids=[item for item in parsed if isinstance(item,str) and item]; open("/tmp/pr_selected_nodeids.txt","w",encoding="utf-8").write("".join(f"{nodeid}\n" for nodeid in nodeids)); print(f"Selected nodeids parsed: {len(nodeids)}")'
154139
else
155140
: > /tmp/pr_selected_nodeids.txt
156141
fi

0 commit comments

Comments
 (0)