Documentation
Installation
Create Action Workflow

There are many ways to set up a workflow.

By Command

The following is a sample configuration for performing translations in command format.

.github/workflows/gpt-translate.yml
name: GPT Translate
 
on:
  issue_comment:
    types: [created]
 
jobs:
  gpt_translate:
    runs-on: ubuntu-latest
 
    steps:
      - uses: actions/checkout@v3
 
      - name: Run GPT Translate
        if: |
          contains(github.event.comment.body, '/gpt-translate') || 
          contains(github.event.comment.body, '/gt')
        uses: 3ru/gpt-translate@master
        with:
          apikey: ${{ secrets.OPENAI_API_KEY }}

Required

  • Provide the OPENAI_API_KEY as apiKey.
    • Necessary for OpenAI model use
  • Checkout in advance(actions/checkout@v3).
    • It must be checkedout before running GPT Translate to retrieve the file contents of the translation.

Once the above workflow is set up and pushed, the translation can be performed by entering commands in the comments of issues and PRs. Demo (opens in a new tab)

Usage

Please refer to the following for details on translation execution.

Other Workflow Example

For other workflows, please refer to the samples below.