Issue #210: validate line ending and file encodings #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 {} + |