File tree Expand file tree Collapse file tree 1 file changed +24
-6
lines changed Expand file tree Collapse file tree 1 file changed +24
-6
lines changed Original file line number Diff line number Diff line change @@ -20,16 +20,34 @@ jobs:
2020 **.md
2121 - name : Check for capital letters or spaces in content directory
2222 run : |
23- echo "Checking for capital letters or spaces in content directory paths..."
23+ echo "Checking for capital letters or spaces in content directory paths (excluding file extensions)..."
24+
25+ tmpfile=$(mktemp)
2426
2527 git diff --name-only origin/${{ github.base_ref }}...HEAD |
2628 grep '^content/' |
27- grep -E '[A-Z]|[[:space:]]' && {
28- echo "❌ Found invalid file or directory names with capital letters or spaces in 'content/'"
29- exit 1
30- }
29+ while read -r path; do
30+ name=$(basename "$path")
31+
32+ # Strip file extension if it exists
33+ base="${name%.*}"
34+
35+ if [[ "$base" =~ [A-Z] || "$base" =~ [[:space:]] ]]; then
36+ echo "Invalid name: $path"
37+ echo "$path" >> "$tmpfile"
38+ fi
39+ done
40+
41+ if [[ -s "$tmpfile" ]]; then
42+ echo "❌ One or more files or directories in 'content/' contain capital letters or spaces (excluding extensions):"
43+ cat "$tmpfile"
44+ rm "$tmpfile"
45+ exit 1
46+ else
47+ rm "$tmpfile"
48+ echo "✅ No capital letters or spaces found in 'content/' paths."
49+ fi
3150
32- echo "✅ No capital letters or spaces found in 'content/' paths."
3351 - name : Install dependencies
3452 if : steps.changed-markdown-files.outputs.any_changed == 'true'
3553 run : pip install -r tools/requirements.txt
You can’t perform that action at this time.
0 commit comments