fix: DAH-3191 fix email address for lottery appeals #35
Workflow file for this run
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
name: Check Translation Files Sorting | |
on: | |
pull_request: | |
paths: | |
- "app/assets/json/translations/react/*.json" | |
jobs: | |
check-sorting: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Verify jq installation | |
run: | | |
if ! command -v jq &> /dev/null; then | |
echo "jq could not be found, installing..." | |
sudo apt-get update && sudo apt-get install -y jq | |
else | |
echo "jq is already installed: $(jq --version)" | |
fi | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "16" | |
- name: Install dependencies | |
run: npm install --global jsonlint-cli | |
- name: Validate and check sorting of translation files | |
run: | | |
for file in app/assets/json/translations/react/*.json; do | |
echo "Checking $file" | |
jsonlint-cli $file | |
jq -S '.' $file > sorted.json | |
if ! diff -uw $file sorted.json > differences.txt; then | |
echo "Sorting errors found in $file:" | |
cat differences.txt | |
rm sorted.json differences.txt | |
exit 1 | |
else | |
echo "$file is properly sorted." | |
rm sorted.json | |
fi | |
done |