Docs

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

  1. 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.
  2. Link a project to a repository and branch (the branch defaults to the repository's default branch).
  3. The repository needs a glotfox.config.json and committed source-locale files (run glotfox extract and 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.

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.