Automate L10n extraction locally and in CI #45
Workflow file for this run
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: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
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 | |
if: github.event_name == 'push' | |
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 | |