-
-
Notifications
You must be signed in to change notification settings - Fork 42
45 lines (38 loc) · 1.45 KB
/
translate.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Translate
on:
workflow_dispatch:
inputs:
file:
description: "File to translate"
required: true
jobs:
translate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set Up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: pip install polib deep_translator && sudo apt update && sudo apt install gettext -y
- name: Run translate.py
run: python scripts/translate.py ${{ github.event.inputs.file }} -t google -s
- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "python-docs-turkish"
git add ${{ github.event.inputs.file }}
git commit -m "Translate ${{ github.event.inputs.file }}"
- name: Create Pull Request
uses: peter-evans/[email protected]
with:
token: ${{ secrets.BOT_PAT }}
commit-message: Translate ${{ github.event.inputs.file }}
author: python-docs-turkish <[email protected]>
committer: python-docs-turkish <[email protected]>
branch: translate-${{ github.event.inputs.file }}
delete-branch: true
title: Translate Translate ${{ github.event.inputs.file }}
body: "Translated: ${{ github.event.inputs.file }}"
labels: new-translation