---
source: https://cli.eloqnt.dev/docs/guides/github-actions
docs_index: https://cli.eloqnt.dev/llms.txt
---

# GitHub Actions

To streamline a continuous localization workflow, you can lint and translate strings automatically on CI systems like GitHub Actions.

By authenticating the CLI with an [API key](https://engine.eloqnt.dev/app/keys), you can invoke it as part of your continuous integration workflow (e.g. on GitHub Actions).

Here's an example workflow that:

1. Checks for lint issues on every push
2. Translates any missing strings once you switch from "Draft" to "Ready for review"

```yaml title=".github/workflows/i18n.yml"
name: i18n
on:
  pull_request:
    types: [opened, synchronize, reopened, ready_for_review]

jobs:
  i18n:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - uses: actions/checkout@v4
        with:
          ref: ${{ github.event.pull_request.head.ref }}
      - run: npm ci

      # Issues should be fixed also in draft mode
      - run: npx eloqnt lint

      # Once ready for review, translate missing strings
      - if: ${{ !github.event.pull_request.draft }}
        env:
          ELOQNT_TOKEN: ${{ secrets.ELOQNT_TOKEN }}
        run: |
          npx eloqnt review
          npx eloqnt translate
          git config user.name "$GITHUB_ACTOR"
          git config user.email "$GITHUB_ACTOR_ID+$GITHUB_ACTOR@users.noreply.github.com"
          git add -A
          git diff --quiet --cached || (git commit -m "Translate missing strings" && git push)
```

Note that commits pushed with the default `GITHUB_TOKEN` don't run workflows. To have workflows run automatically on pushed commits, create a fine-grained personal access token with read and write access, and pass it to the checkout step:

```yaml title=".github/workflows/i18n.yml"
# ...
- uses: actions/checkout@v4
  with:
    ref: ${{ github.event.pull_request.head.ref }}
    token: ${{ secrets.GH_TOKEN }}
# ...
```

---

For an index of every eloqnt/cli documentation page, see [https://cli.eloqnt.dev/llms.txt](https://cli.eloqnt.dev/llms.txt).
