Skip to content

Commit

Permalink
Add translate action (temporary)
Browse files Browse the repository at this point in the history
  • Loading branch information
egeakman committed Sep 22, 2023
1 parent e7e70d4 commit ae0dca2
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/translate.yaml
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

0 comments on commit ae0dca2

Please sign in to comment.