We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 21461e6 commit 5eed9adCopy full SHA for 5eed9ad
.github/workflows/prettier.yml
@@ -24,7 +24,21 @@ jobs:
24
| grep -E '\.(ts|tsx|js|jsx|json|md|yaml|yml|css|scss)$' || true)
25
26
if [ -n "$CHANGED_FILES" ]; then
27
- echo "$CHANGED_FILES" | xargs yarn prettier --write
+ FILES_TO_FORMAT=""
28
+
29
+ while IFS= read -r file; do
30
+ if [ -f "$file" ]; then
31
+ FILES_TO_FORMAT="$FILES_TO_FORMAT\n$file"
32
+ else
33
+ echo "Skipping missing file: $file"
34
+ fi
35
+ done <<< "$CHANGED_FILES"
36
37
+ if [ -n "$FILES_TO_FORMAT" ]; then
38
+ printf "%b\n" "$FILES_TO_FORMAT" | sed '/^$/d' | xargs yarn prettier --write
39
40
+ echo "No existing files to format"
41
42
else
43
echo "No files to format"
44
fi
0 commit comments