Skip to content

Commit

Permalink
Simplify the check
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Kern <[email protected]>
  • Loading branch information
andreaskern74 committed Feb 27, 2024
1 parent 63be117 commit f24a82a
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions .github/workflows/filename-check.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
name: Filename Check

on: [push, pull_request]
on: [push]

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
if [ ! -z "$with_capitals" ]; 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
- uses: actions/checkout@v2
- name: Check for capital letters in filenames in 'doc/manual'
run: |
files_with_caps=$(find doc/manual -type f | grep '[A-Z]')
if [ ! -z "$files_with_caps" ]; then
echo "Files with capital letters:"
echo "$files_with_caps"
exit 1
fi

0 comments on commit f24a82a

Please sign in to comment.