Skip to content

Issue 1 revision 1 #129

Issue 1 revision 1

Issue 1 revision 1 #129

Workflow file for this run

name: hugo i18n check
on:
pull_request:
# versions should be kept in sync with gh-pages and lighthouse-ci workflow
env:
HUGO_VERSION: 0.119.0 # if you update this, change the README badge and lighthouse-ci.yml too!
NODE_VERSION: 18 # if you update this, change the README badge and lighthouse-ci.yml too!
jobs:
build-deploy:
name: Check Hugo i18n translations
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v3
- name: setup hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: ${{ env.HUGO_VERSION }}
extended: true
- name: setup node.js
uses: actions/setup-node@v2-beta
with:
node-version: ${{ env.NODE_VERSION }}
- name: fetch js dependencies from cache
uses: actions/cache@v2
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: |
npm-${{ hashFiles('package-lock.json') }}
npm-
- name: install js dependencies
run: npm ci
- name: Generate Hugo i18n warnings
run: hugo --printI18nWarnings | grep MISSING_TRANSLATION > /tmp/i18n-warnings.txt || true
# check if file is empty
- name: Check for any missing translations from Hugo i18n warnings
run: if [[ -s /tmp/i18n-warnings.txt ]]; then cat /tmp/i18n-warnings.txt && exit 1; else echo "No missing translations"; fi