diff options
author | 0neGal <mail@0negal.com> | 2024-07-23 17:08:32 +0200 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2024-07-23 17:09:12 +0200 |
commit | 5ddec759a2a71c553cfffbab02033fdb37470a2d (patch) | |
tree | 8b362ba722b5e83f47f2d69e04ffb35edd0a948e | |
parent | 877d0e5d50712fb0a3ee915d3bbf6991c39f8b7c (diff) | |
download | Viper-5ddec759a2a71c553cfffbab02033fdb37470a2d.tar.gz Viper-5ddec759a2a71c553cfffbab02033fdb37470a2d.zip |
added "Check localizations" action
-rw-r--r-- | .github/workflows/localizations.yml | 21 | ||||
-rw-r--r-- | scripts/langs.js | 12 |
2 files changed, 31 insertions, 2 deletions
diff --git a/.github/workflows/localizations.yml b/.github/workflows/localizations.yml new file mode 100644 index 0000000..072d0bc --- /dev/null +++ b/.github/workflows/localizations.yml @@ -0,0 +1,21 @@ +name: Localizations +on: + push: + pull_request: + types: [opened, reopened] + +jobs: + check-localizations: + name: "Check localizations" + runs-on: "ubuntu-latest" + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Setup Node environment + uses: actions/setup-node@v3 + with: + node-version: 20 + - name: Install dependencies + run: npm install + - name: Check localizations + run: npm run langs:check diff --git a/scripts/langs.js b/scripts/langs.js index 23b9924..b2f5287 100644 --- a/scripts/langs.js +++ b/scripts/langs.js @@ -361,10 +361,18 @@ let check = (logging = true) => { // run `check()` if `--check()` is set if (args["check"]) { - let problems = check(); + let has_problems = false; + + // check localizations, and set `has_problems` depending on whether + // any localization files have problems + Object.values(check()).forEach((item) => { + if (item.length) { + has_problems = true; + } + }); // exit with the correct exit code - if (problems.length) { + if (has_problems) { process.exit(1); } else { process.exit(); |