Create new auto translation github actions workflow #24
Workflow file for this run
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
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 $changed_files; 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 |