-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
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: Clone CPython Repo | ||
run: git clone https://github.com/python/cpython venv/cpython | ||
|
||
- name: Set Up Python 3.12 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.12-dev" | ||
|
||
- name: Install dependencies | ||
run: pip install -r requirements.txt && sudo apt update && sudo apt install gettext -y | ||
|
||
- name: Run translate.py | ||
run: python 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 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 |