File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -34,10 +34,21 @@ jobs:
34
34
id : set-matrix
35
35
run : |
36
36
# Group the output by platform.
37
- GROUPS=$(gh api "repos/$GITHUB_REPOSITORY/commits/$GITHUB_SHA/check-runs" --paginate \
38
- --jq '.check_runs[] | select(.name | endswith("-env")) | { "config": .name, "build_path": .output.text }' | \
39
- jq --slurp -c -r '. as $jobs | map(.config | split(".") | first) | unique | map(. as $group | {"platform": $group, "jobs": $jobs | map(select(.config |startswith($group)))})')
40
- echo "matrix=${GROUPS}" >> $GITHUB_OUTPUT
37
+ set -x
38
+ CHECK_RUNS=$(gh api "repos/$GITHUB_REPOSITORY/commits/$GITHUB_SHA/check-runs" --paginate)
39
+ echo "Check Runs: $CHECK_RUNS"
40
+
41
+ FILTERED=$(echo "$CHECK_RUNS" | jq -r '.check_runs[] | select(.name | endswith("-env")) | { "config": .name, "build_path": .output.text }')
42
+ echo "Filtered: $FILTERED"
43
+
44
+ GROUPS=$(echo "$FILTERED" | jq --slurp -c -r '. as $jobs | map(.config | split(".") | first) | unique | map(. as $group | {"platform": $group, "jobs": $jobs | map(select(.config |startswith($group)))})')
45
+ if jq -e . <<< "$GROUPS" > /dev/null 2>&1; then # JSON validation
46
+ echo "Valid JSON"
47
+ else
48
+ echo "Invalid JSON: $GROUPS"
49
+ exit 1 # or handle the error appropriately
50
+ fi
51
+ echo "matrix=$GROUPS" >> $GITHUB_OUTPUT
41
52
42
53
# We need this process step in here, because we have in excess of 256 jobs.
43
54
process :
You can’t perform that action at this time.
0 commit comments