format check shows green check, not anymore when format shows fail #110

Merged
zach merged 1 commits from format-check-rust-fix into main 2026-05-29 11:50:10 +02:00
Showing only changes of commit 0c47ba805f - Show all commits
+3 -1
View File
@@ -42,11 +42,13 @@ jobs:
continue-on-error: true continue-on-error: true
run: | run: |
if [ -n "$(find . -name "Cargo.toml" -print -quit)" ]; then if [ -n "$(find . -name "Cargo.toml" -print -quit)" ]; then
status=0
for manifest in $(find . -name "Cargo.toml"); do for manifest in $(find . -name "Cargo.toml"); do
cargo fmt --manifest-path "$manifest" --check && \ cargo fmt --manifest-path "$manifest" --check && \
echo "$manifest: formatting OK" || \ echo "$manifest: formatting OK" || \
echo "$manifest: needs formatting" { echo "$manifest: needs formatting"; status=1; }
done done
exit $status
elif [ -n "$(find . -name "*.rs" -print -quit)" ]; then elif [ -n "$(find . -name "*.rs" -print -quit)" ]; then
echo "Rust files found but no Cargo.toml" echo "Rust files found but no Cargo.toml"
exit 1 exit 1