Update translate_es.yml

This commit is contained in:
Carlos Polop 2023-06-01 13:28:45 +02:00 committed by GitHub
parent 2afacb0200
commit 495ed91c0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,13 +57,14 @@ jobs:
# Start a subshell with a timeout (5h)
timeout 18000s bash << 'EOF'
echo "Starting translations"
echo "Commit: $GITHUB_SHA"
#echo "Commit: $GITHUB_SHA"
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 "$GITHUB_SHA" | grep -v "SUMMARY.md" | while read -r file; do
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 "Translating $file"
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" --file-path "$file"
@ -78,4 +79,4 @@ jobs:
git checkout "$BRANCH"
git add -A
git commit -m "Translated $BRANCH files" || true
git push --set-upstream origin "$BRANCH"
git push --set-upstream origin "$BRANCH"