From 68ddbf4856fd98fb3a5ac597f6c30aa538f3f00c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deluan=20Quint=C3=A3o?= Date: Sat, 31 Aug 2024 14:54:04 -0400 Subject: [PATCH] Add i18n lint job --- .github/workflows/pipeline.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 43732d34c..9eb338b87 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -99,10 +99,26 @@ jobs: name: js-bundle path: ui/build retention-days: 7 + i18n-lint: + name: Lint i18n files + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: | + set -e + for file in resources/i18n/*.json; do + echo "Validating $file" + if ! jq empty "$file" 2>error.log; then + error_message=$(cat error.log) + line_number=$(echo "$error_message" | grep -oP 'line \K[0-9]+') + echo "::error file=$file,line=$line_number::$error_message" + exit 1 + fi + done binaries: name: Build binaries - needs: [js, go, go-lint] + needs: [js, go, go-lint, i18n-lint] runs-on: ubuntu-latest container: deluan/ci-goreleaser:1.23.0-1 steps: