多言語のReadMeの自動翻訳actionsの修正 #6
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: Translate README | |
on: | |
pull_request: | |
branches: | |
- develop | |
paths: | |
- README.md | |
jobs: | |
translate: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/[email protected] | |
- name: Set up Python | |
uses: actions/[email protected] | |
with: | |
python-version: '3.11' | |
- name: Install OpenAI library | |
run: pip install openai | |
- name: Run translation script | |
env: | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
run: python .github/scripts/translate_readme.py | |
- name: Commit changes | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add README_EN.md README_CN.md | |
git commit -m "Update translations" || echo "No changes to commit" | |
git push |