From 83ab77c8d465b3769398a7d8323f5ea92fc8ccd3 Mon Sep 17 00:00:00 2001 From: Translator workflow Date: Thu, 1 Jun 2023 14:29:17 +0200 Subject: [PATCH] f --- .github/workflows/translate_es.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/translate_es.yml b/.github/workflows/translate_es.yml index 1a62c7d2..a8d28b5a 100644 --- a/.github/workflows/translate_es.yml +++ b/.github/workflows/translate_es.yml @@ -25,6 +25,30 @@ jobs: with: fetch-depth: 0 #Needed to download everything to be able to access the master & language branches + - name: Run translation script on changed files + run: | + # Start a subshell with a timeout (5h) + + echo "Starting translations" + echo "Commit: 0afe4e4475ddd0e31b7b8957df1e0e9bb275b731" + + # Export the OpenAI API key as an environment variable + export OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} + + # Run the translation script on each changed file + git diff-tree --no-commit-id --name-only -r "0afe4e4475ddd0e31b7b8957df1e0e9bb275b731" + echo "===========" + git diff-tree --no-commit-id --name-only -r "0afe4e4475ddd0e31b7b8957df1e0e9bb275b731" | grep -v "SUMMARY.md" | while read -r file; do + if echo "$file" | grep -qE '\.md$'; then + echo $file + PATHS="$file , $PATHS" + else + echo "Skipping $file" + fi + done + + echo "Translating $PATHS" + - name: Set up Python uses: actions/setup-python@v2 with: