Skip to content

Commit

Permalink
chore: 💊 add check for localize lines
Browse files Browse the repository at this point in the history
  • Loading branch information
flixlix authored Jul 25, 2023
1 parent a623b55 commit 998725b
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/check_localize_lines.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Check Lines of Localize Files

on:
push:

jobs:
check_json_lines:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 14

- name: Install Dependencies
run: npm install jsonlint -g

- name: Check JSON Files
run: |
# Navigate to the languages directory
cd src/localize/languages
# Get the list of all JSON files
files=$(ls *.json)
# Check the number of lines in the first file
expected_lines=$(wc -l < "$files")
# Loop through all files and check the line count
for file in $files; do
current_lines=$(wc -l < "$file")
if [ "$current_lines" -ne "$expected_lines" ]; then
echo "ERROR: $file does not have the same number of lines as other JSON files."
exit 1
fi
done

0 comments on commit 998725b

Please sign in to comment.