# gt: General Translation CLI tool: Using GitHub Actions
URL: https://generaltranslation.com/en-GB/docs/cli/guides/continuous-translation/using-github-actions.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: How to automate translation pull requests with the General Translation GitHub Action.

Use the [`generaltranslation/translate`](https://github.com/generaltranslation/translate) GitHub Action when you keep generated translations in version control and want automated pull requests on every push to `main`.

## Set-up [#setup]

1. Commit `gt.config.json` and add `GT_API_KEY` and `GT_PROJECT_ID` under GitHub **Settings &gt; Secrets and variables &gt; Actions**. (See [Shared requirements](/docs/cli/guides/continuous-translation#credentials)).
2. Add a workflow file at `.github/workflows/translate.yml`:

```yaml title=".github/workflows/translate.yml"
name: GT Translate

on:
  push:
    branches: [main]

jobs:
  translate:
    runs-on: ubuntu-latest
    if: ${{ github.event.head_commit.author.name != 'github-actions[bot]' && !contains(github.event.head_commit.message, 'gt-translate/') }}
    permissions:
      contents: write
      pull-requests: write
    steps:
      - uses: actions/checkout@v4

      - uses: generaltranslation/translate@v0
        with:
          gt_api_key: ${{ secrets.GT_API_KEY }}
          gt_project_id: ${{ secrets.GT_PROJECT_ID }}
          config: 'gt.config.json'
          pr_branch: 'gt-translate/${{ github.ref_name }}'
```

The action runs [`gt translate`](/docs/cli/reference/commands/translate), commits updated files, and opens a pull request when changes exist.

## Common inputs [#inputs]

* `app_directory`: relative path to the app folder in a monorepo.
* `pr_auto_merge`: set to `'true'` to squash-merge the pull request automatically when repository rules allow it.
* `pr_title` and `pr_body`: customise the pull request title and description.
* `dry_run`: set to `'true'` to validate without calling the API.
* `version`: pin a CLI version (defaults to `latest`).

## Next steps

- /docs/cli/guides/continuous-translation/running-in-cd
- /docs/cli/guides/continuous-translation/staging-in-ci
- /docs/cli/guides/continuous-translation/splitting-ci-stages
- /docs/cli/guides/generating-translations

## Sitemap

See the full [sitemap](https://generaltranslation.com/sitemap.md) for all pages.
