Skip to main content

GitHub Action Integration

Check every locale file on every pull request, with inline annotations. No API key.

Features

Fails the PR on dropped or renamed placeholders, collapsed plurals and invalid ICU
Inline PR annotations via SARIF, each with a one-line fix
No key, no account, no model calls: deterministic and offline
severity and baseline inputs, so an existing catalog can adopt it without a cleanup sprint
Optional translate mode with your own Anthropic or OpenAI key

Prerequisites

  • 1.A GitHub repository with locale files (JSON, YAML, ARB, xcstrings, Android, gettext or XLIFF)
  • 2.Translate mode only: an LLM API key stored as a repository secret

Installation

# .github/workflows/i18n.yml
uses: Shipi18n/shipi18n-github-action@v3

Configuration

Check mode needs nothing configured beyond the locale path. Give the job security-events: write so the SARIF upload can annotate the PR. Translate mode additionally needs your key as a repository secret and contents: write (or pull-requests: write to open a PR).

Usage

uses: Shipi18n/shipi18n-github-action@v3

Examples

Check every pull request

name: i18n check
on: [pull_request]
permissions:
  contents: read
  security-events: write
jobs:
  i18n:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: Shipi18n/shipi18n-github-action@v3
        with:
          locales: ./locales
          severity: 'missing-key=off,untranslated=off,orphan-key=off'
      - uses: github/codeql-action/upload-sarif@v3
        if: always()
        with:
          sarif_file: shipi18n.sarif

Fail only on new findings (baseline)

      - uses: Shipi18n/shipi18n-github-action@v3
        with:
          locales: ./locales
          baseline: .shipi18n/baseline.json   # npx @shipi18n/cli check ./locales --write-baseline

Optional: retranslate on main with your own key

      - uses: Shipi18n/shipi18n-github-action@v3
        with:
          mode: translate
          source-file: locales/en.json
          target-languages: es,fr,de
          api-key: ${{ secrets.ANTHROPIC_API_KEY }}
          create-pr: 'true'
          skip-paths: 'legal.*,brand.*'   # globs; skip-keys takes exact paths

Best Practices

  • Run the check on pull_request, filtered to your locale paths if CI minutes matter.
  • Start with severity off for missing/untranslated keys; tighten once the catalog is clean.
  • Pin @v3 (moves with minor releases, never across breaking changes) or an exact tag like @v3.1.0.
  • If you translate in CI, keep the check job: it is what tells you the translation still works.

Troubleshooting

Hundreds of missing-key findings on the first run

Translations that haven't arrived yet: add severity: 'missing-key=off,untranslated=off,orphan-key=off', or record a baseline.

No annotations on the PR

Add the github/codeql-action/upload-sarif step with if: always(), and give the job security-events: write.

Translate mode: missing API key

Pass api-key from a repository secret, or set ANTHROPIC_API_KEY in the job env. Check mode never needs one.