Skip to content

Commit a02cf50

Browse files
markkovariclaude
andcommitted
fix: prevent empty matrix values when no projects change
When only non-code files (like README.md) change, the change detection was outputting [""] instead of []. This caused jobs to run with empty matrix values, leading to failures: - cargo test failing with "could not find Cargo.toml" - dotnet restore failing with "no project or solution file" Now properly outputs [] when no projects are detected, preventing jobs from running with empty matrix values. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 3f083a1 commit a02cf50

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

.github/workflows/tests.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,23 @@ jobs:
6969
fi
7070
done
7171
72-
RUST_PROJECTS=$(printf '%s\n' "${RUST_PROJECTS[@]}" | jq -R . | jq -s -c .)
73-
GO_PROJECTS=$(printf '%s\n' "${GO_PROJECTS[@]}" | jq -R . | jq -s -c .)
74-
CSHARP_PROJECTS=$(printf '%s\n' "${CSHARP_PROJECTS[@]}" | jq -R . | jq -s -c .)
72+
if [ ${#RUST_PROJECTS[@]} -eq 0 ]; then
73+
RUST_PROJECTS="[]"
74+
else
75+
RUST_PROJECTS=$(printf '%s\n' "${RUST_PROJECTS[@]}" | jq -R . | jq -s -c .)
76+
fi
77+
78+
if [ ${#GO_PROJECTS[@]} -eq 0 ]; then
79+
GO_PROJECTS="[]"
80+
else
81+
GO_PROJECTS=$(printf '%s\n' "${GO_PROJECTS[@]}" | jq -R . | jq -s -c .)
82+
fi
83+
84+
if [ ${#CSHARP_PROJECTS[@]} -eq 0 ]; then
85+
CSHARP_PROJECTS="[]"
86+
else
87+
CSHARP_PROJECTS=$(printf '%s\n' "${CSHARP_PROJECTS[@]}" | jq -R . | jq -s -c .)
88+
fi
7589
fi
7690
7791
echo "rust_projects=$RUST_PROJECTS" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)