Skip to content

Issue #210: validate line ending and file encodings #1

Issue #210: validate line ending and file encodings

Issue #210: validate line ending and file encodings #1

on:
- push
name: Check File Encodings
jobs:
check_encoding:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Check file encodings
run: |
find . -type f ! -path "./.git/*" -exec sh -c '
for file do
encoding=$(file -bi "$file" | awk -F "=" '{print $2}')
if [ "$encoding" != "utf-8" ]; then
echo "File $file has encoding $encoding"
exit 1
fi
done
' sh {} +