Skip to content

Commit 7da05e3

Browse files
fix json parsing
1 parent 12ead11 commit 7da05e3

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

.github/workflows/test.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,16 @@ jobs:
4242
FILTERED_NBS+=("$nb")
4343
fi
4444
done
45+
46+
NB_JSON=$(printf '%s\n' "${FILTERED_NBS[@]}" | jq -R . | jq -s -c .)
4547
46-
# Convert filtered list into JSON array so it can be passed to matrix
47-
NB_JSON=$(printf '%s\n' "${FILTERED_NBS[@]}" | jq -R . | jq -s .)
48-
echo "Changed notebooks: $NB_JSON"
49-
echo "::set-output name=notebooks::$NB_JSON"
48+
# Ensure at least "[]" if empty
49+
if [ -z "$NB_JSON" ] || [ "$NB_JSON" = "[]" ]; then
50+
NB_JSON="[]"
51+
fi
52+
53+
echo "All valid notebooks: $NB_JSON"
54+
echo "notebooks=$NB_JSON" >> $GITHUB_OUTPUT
5055
5156
# ---------------------------------------------------------
5257
# 2) Test each changed notebook in parallel

0 commit comments

Comments
 (0)