Skip to content

Create new auto translation github actions workflow #23

Create new auto translation github actions workflow

Create new auto translation github actions workflow #23

name: Auto Translation
on:
pull_request:
paths:
- content/english/**
jobs:
auto-translate:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x' # or the version your project requires
- name: Run Translation Tool
env:
GITHUB_TOKEN: ${{ secrets.MODELS_TOKEN }}
run: |
languages=("french" "spanish" "portuguese" "german" "kyrgyz" "simplified-chinese" "traditional-chinese")
changed_files=$(git diff --name-only -r HEAD^1 HEAD | grep '^content/english/.*/[^/]*\.md$')
for file in $file; do
echo "Translating $file"
for lang in "${languages[@]}"; do
# dotnet run --project translation-tool/WorkshopAutoTranslation/WorkShopTranslationV2 -- "$file" "$lang"
done
done
- uses: stefanzweifel/git-auto-commit-action@v4