Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add encoding check workflow to ensure all the files having utf-8 encoding and vale continue-on-error #2700

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/encoding-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Encoding Checker

on: [pull_request]

jobs:
encoding-checker:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Check for possible file that does not follow utf-8 encoding
run: |
set +e
IFS=$(echo -en "\n\b")
COUNTER=0
for i in `find . -type f \( -name "*.txt" -o -name "*.md" -o -name "*.markdown" -o -name "*.html" \) | grep -vE "^./.git"`;
do
grep -axv '.*' "$i"
if [ "$?" -eq 0 ]; then
echo -e "######################\n$i\n######################"
COUNTER=$(( COUNTER + 1 ))
fi
done
if [ "$COUNTER" != 0 ]; then
echo "Found files that is not following utf-8 encoding, exit 1"
exit 1
fi
1 change: 1 addition & 0 deletions .github/workflows/vale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ jobs:
filter_mode: added
vale_flags: "--no-exit"
version: 2.28.0
continue-on-error: true
Loading