🎉 v1.0

Get started

  • Welcome
  • Documentation
  • Pricing
    Soon

Tools

  • I18n MCP
  • CLI
  • CI/CD Integrations
  • Compiler
    Alpha
  • Connect Your Engine

Resources

  • Languages
  • LLM Models
  • Guides

Company

  • Enterprise
  • CareersHiring!
Dashboard

Continuous Localization

  • How it works
  • Setup
  • Advanced patterns

Platforms

  • GitHub
  • BitBucket
  • GitLab

GitHub Actions

Max PrilutskiyMax Prilutskiy·Updated 1 day ago·2 min read

The official Lingo.dev GitHub Action runs the localization pipeline on every push, committing translations directly or opening a pull request depending on your workflow.

Prerequisites

Complete the CI/CD Setup first. You need a working i18n.json and LINGODOTDEV_API_KEY stored as a repository secret.

Minimal setup#

Create .github/workflows/translate.yml:

yaml
name: Translate
on:
  push:
    branches: [main]
permissions:
  contents: write
jobs:
  translate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Lingo.dev
        uses: lingodotdev/lingo.dev@main
        with:
          api-key: ${{ secrets.LINGODOTDEV_API_KEY }}

This commits translations directly to main on every push.

Workflow examples#

Commit to main#

yaml
name: Translate
on:
  push:
    branches: [main]
permissions:
  contents: write
jobs:
  translate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Lingo.dev
        uses: lingodotdev/lingo.dev@main
        with:
          api-key: ${{ secrets.LINGODOTDEV_API_KEY }}

Pull request from main#

yaml
name: Translate
on:
  push:
    branches: [main]
permissions:
  contents: write
  pull-requests: write
jobs:
  translate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Lingo.dev
        uses: lingodotdev/lingo.dev@main
        with:
          api-key: ${{ secrets.LINGODOTDEV_API_KEY }}
          pull-request: true
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Enable Settings > Actions > General > Allow GitHub Actions to create and approve pull requests for PR-based workflows.

Commit to feature branch#

yaml
name: Translate
on:
  push:
    branches-ignore: [main]
permissions:
  contents: write
jobs:
  translate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Lingo.dev
        uses: lingodotdev/lingo.dev@main
        with:
          api-key: ${{ secrets.LINGODOTDEV_API_KEY }}

Pull request from feature branch#

yaml
name: Translate
on:
  push:
    branches-ignore: [main]
permissions:
  contents: write
  pull-requests: write
jobs:
  translate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Lingo.dev
        uses: lingodotdev/lingo.dev@main
        with:
          api-key: ${{ secrets.LINGODOTDEV_API_KEY }}
          pull-request: true
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Available inputs#

InputDefaultDescription
api-keyRequiredLingo.dev API key
pull-requestfalseCreate a pull request instead of committing directly
commit-messagefeat: update translations via @LingoDotDevCustom commit message
pull-request-titlefeat: update translations via @LingoDotDevCustom PR title
commit-author-nameLingo.devGit commit author name
commit-author-emailsupport@lingo.devGit commit author email
working-directory.Working directory for monorepos
process-own-commitsfalseProcess commits made by this action
parallelfalseRun in parallel mode
versionlatestLingo.dev CLI version
gpg-signfalseEnable GPG commit signing

GPG commit signing#

For repositories that require signed commits (branch protection rules):

yaml
- name: Import GPG key
  uses: crazy-max/ghaction-import-gpg@v6
  with:
    gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
    passphrase: ${{ secrets.GPG_PASSPHRASE }}
    git_user_signingkey: true
    git_commit_gpgsign: true

- name: Lingo.dev
  uses: lingodotdev/lingo.dev@main
  with:
    api-key: ${{ secrets.LINGODOTDEV_API_KEY }}
    gpg-sign: true

Store the base64-encoded GPG private key as GPG_PRIVATE_KEY in repository secrets. Omit passphrase if the key has none.

Next Steps#

Advanced Patterns
Translation checks, merge conflicts, workflow selection
GitLab CI/CD
Set up GitLab CI/CD integration
Bitbucket Pipelines
Set up Bitbucket Pipelines integration
Connect Your Engine
Route CI/CD translations through your engine

Was this page helpful?