Skip to content

Extract locales automatically in CI #38

Extract locales automatically in CI

Extract locales automatically in CI #38

Workflow file for this run

name: CI
on:
push:
branches:
- master
- localization
jobs:
locales:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'
- name: Install gettext
run: sudo apt-get install gettext
- name: Yarn install
run: yarn install --frozen-lockfile --prefer-offline
- name: Extract locales
run: yarn extract-locales
- name: Push Locales
env:
# The default branch of the repository, in this case "master"
default_branch: ${{ github.event.repository.default_branch }}
run: |
# Stable check for if the workflow is running on the default branch
# https://stackoverflow.com/questions/64781462/github-actions-default-branch-variable
is_default_branch="${{ format('refs/heads/{0}', env.default_branch) == github.ref }}"
ARGS=""
if [[ "$is_default_branch" == 'false' ]]; then
ARGS="--dry-run"
fi
./bin/push-locales $ARGS