GitHub integration
There are two independent parts: the GitHub App imports source keys from your repository, and a GitHub Actions workflow that runs the CLI checks keys and types in CI.
GitHub App
- Install the GlotFox GitHub App on your account or organization and choose the repositories it may read. The installation is tied to your GlotFox organization.
- Link a project to a repository and branch (the branch defaults to the repository's default branch).
- The repository needs a
glotfox.config.jsonand committed source-locale files (runglotfox extractand commit the result).
On every push to the linked branch, GlotFox reads glotfox.config.json and the source-locale files and imports their keys, texts and descriptions into the project. If the config is missing, the import reports an error. Uninstalling the app unlinks its projects.
GitHub Actions workflow
name: i18n
on:
push:
branches: [main]
pull_request:
jobs:
glotfox:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v5
with:
node-version: 22
- run: npm ci
# Pull requests: fail if keys weren't extracted or generated types are stale.
- if: github.event_name == 'pull_request'
run: npx glotfox check && npx tsc --noEmit
# Pushes to main: upload new and changed source keys.
- if: github.event_name == 'push'
run: npx glotfox extract && npx glotfox push
env:
GLOTFOX_API_KEY: ${{ secrets.GLOTFOX_API_KEY }}
Add your project API key as the repository secret GLOTFOX_API_KEY.
- Pull requests run
glotfox checkand then your type-check. The build fails if you forgot to runglotfox extractor the generated types are stale. - Pushes to the default branch run
extractandpush. Nothing is committed back.
If glotfox.config.json is not at the repository root, add working-directory: path/to/app to the two run steps. Leave out npx tsc --noEmit if you don't generate types.
To bring approved translations back into the repository, run glotfox pull locally or in your own workflow and commit the result.