Skip to content

Commit 8fc3b67

Browse files
authored
Merge pull request #2700 from peterzhuamazon/Add-utf8-checker
Add encoding check workflow to ensure all the files having utf-8 encoding and value continue-on-error
2 parents ff36da8 + 75f69bb commit 8fc3b67

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

.github/workflows/encoding-check.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Encoding Checker
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
encoding-checker:
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+
IFS=$(echo -en "\n\b")
15+
COUNTER=0
16+
for i in `find . -type f \( -name "*.txt" -o -name "*.md" -o -name "*.markdown" -o -name "*.html" \) | grep -vE "^./.git"`;
17+
do
18+
grep -axv '.*' "$i"
19+
if [ "$?" -eq 0 ]; then
20+
echo -e "######################\n$i\n######################"
21+
COUNTER=$(( COUNTER + 1 ))
22+
fi
23+
done
24+
if [ "$COUNTER" != 0 ]; then
25+
echo "Found files that is not following utf-8 encoding, exit 1"
26+
exit 1
27+
fi

.github/workflows/vale.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ jobs:
2222
filter_mode: added
2323
vale_flags: "--no-exit"
2424
version: 2.28.0
25+
continue-on-error: true

0 commit comments

Comments
 (0)