An IssueOps workflow that translates text between languages using GitHub Issues, GitHub Actions, and the GitHub Models API.
- Translate text between languages by commenting on a GitHub Issue.
- Source and target languages are read from the issue body.
- The triggering comment is edited in place to include both the original and the translated text.
- Manual
workflow_dispatchmode also supported.
main.py calls the GitHub Models API at https://models.github.ai/inference (model: openai/gpt-5-mini) using the OpenAI SDK with a GitHub PAT. parse_issue.py extracts the source_lang / target_lang fields from the issue body so the translator knows which languages to translate between.
Add a repository secret named GH_TOKEN containing a token with repo and issues scopes and access to GitHub Models.
Create an issue using the Translation template and fill in:
source_lang: English
target_lang: FrenchAdd a comment containing the text you want translated. The workflow will:
- Detect the new comment.
- Parse the issue body for
source_lang/target_lang. - Translate the comment text via the GitHub Models API.
- Edit the comment to include both the original and the translated text.
You can also dispatch the workflow manually from the Actions tab and pass the text to translate as input.
main.py— Calls the GitHub Models API and prints the translated text.parse_issue.py— Parses the source/target languages out of the issue body.requirements.txt— Python dependencies (openai).