File tree 1 file changed +28
-0
lines changed
1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Encoding Checker
2
+
3
+ on : [pull_request]
4
+
5
+ jobs :
6
+ extendedAsciiAndBom :
7
+ runs-on : ubuntu-latest
8
+ steps :
9
+ - name : Checkout repository
10
+ uses : actions/checkout@v3
11
+ - name : Check for possible file that does not follow utf-8 encoding
12
+ run : |
13
+ set +e
14
+ wget https://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html
15
+ IFS=$(echo -en "\n\b")
16
+ COUNTER=0
17
+ for i in `find . -type f \( -name "*.txt" -o -name "*.md" -o -name "*.markdown" -o -name "*.html" \) | grep -vE "^./.git"`;
18
+ do
19
+ grep -axv '.*' "$i"
20
+ if [ "$?" -eq 0 ]; then
21
+ echo -e "######################\n$i\n######################"
22
+ COUNTER=$(( COUNTER + 1 ))
23
+ fi
24
+ done
25
+ if [ "$COUNTER" != 0 ]; then
26
+ echo "Found files that is not following utf-8 encoding, exit 1"
27
+ exit 1
28
+ fi
You can’t perform that action at this time.
0 commit comments