Skip to content

Check filename convention #2

Check filename convention

Check filename convention #2

Workflow file for this run

name: Filename Check
on: [push, pull_request]
jobs:
check-filenames:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Check filenames for Windows compatibility # currently restricted to doc folder
run: |
with_capitals=$(find ./doc -type f \( -iname "*.md" -o -iname "*.png" \) | grep -E '/[A-Z]')
with_invalid_chars=$(find . -type f | grep -E '[<>:"/\\|?*]|[[:cntrl:]]')
if [ ! -z "$with_capitals" ] || [ ! -z "$with_invalid_chars" ]; then
echo "The following files do not follow the naming convention:"
[ ! -z "$with_capitals" ] && echo "Files with capitals:" && echo "$with_capitals"
[ ! -z "$with_invalid_chars" ] && echo "Files with Windows-restricted characters:" && echo "$with_invalid_chars"
exit 1
fi