Issue 5 #151
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: hugo i18n check | |
on: | |
pull_request: | |
jobs: | |
build-deploy: | |
name: Check Hugo i18n translations | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout repository | |
uses: actions/checkout@v3 | |
- name: Get Hugo version | |
run: echo "HUGO_VERSION=$(cat .hugo_version)" >> $GITHUB_ENV | |
- name: setup hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: ${{ env.HUGO_VERSION }} | |
extended: true | |
- name: Get node version from package.json | |
run: echo "NODE_VERSION=$(cat package.json | jq -r '.volta.node')" >> $GITHUB_ENV | |
- 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 | |