fix(ci): fix jq command with -R raw input flag

- Also fix quick_check to only fail on missing keys (not untranslated)
- Use compact JSON for GITHUB_OUTPUT
This commit is contained in:
zenobit
2026-03-30 05:10:23 +02:00
parent 86334452c0
commit 5bb99f941c
2 changed files with 43 additions and 1 deletions

View File

@@ -32,6 +32,47 @@ jobs:
- run: npm run typecheck:core
- run: npm run typecheck:noimplicit:core
i18n:
name: i18n Validation
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
lang: ${{ fromJson(needs.i18n-matrix.outputs.langs) }}
needs: i18n-matrix
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Validate ${{ matrix.lang }}
run: |
echo "Validating language: ${{ matrix.lang }}"
python3 scripts/validate_translation.py quick -l '${{ matrix.lang }}'
- name: Report to summary
if: always()
run: |
echo "### ${{ matrix.lang }} Translation Report" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
python3 scripts/validate_translation.py quick -l '${{ matrix.lang }}' >> $GITHUB_STEP_SUMMARY 2>&1
echo '```' >> $GITHUB_STEP_SUMMARY
i18n-matrix:
name: Build language matrix
runs-on: ubuntu-latest
outputs:
langs: ${{ steps.langs.outputs.langs }}
steps:
- uses: actions/checkout@v4
- name: Generate language list
id: langs
run: |
LANG_DIR="src/i18n/messages"
LANGS=$(ls "$LANG_DIR"/*.json | xargs -n1 basename | sed 's/.json$//' | grep -v '^en$' | jq -R . | jq -s .)
echo "langs=${LANGS}" >> $GITHUB_OUTPUT
echo "Found languages:"
echo "$LANGS"
security:
name: Security Audit
runs-on: ubuntu-latest

View File

@@ -396,7 +396,8 @@ def quick_check() -> int:
print(f"Missing: {len(missing)}")
print(f"Untranslated: {len(untranslated)}")
return 0 if not missing and not untranslated else 1
# Only fail on missing keys, untranslated is acceptable
return 0 if not missing else 1
def show_diff(category: str) -> int: