From 974eccc487fdcda1ff2ebea56f4e51f2b59fa5f8 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 15 Mar 2024 15:16:07 +0000 Subject: [PATCH] Add ChatGPT suggestion --- .github/workflows/update_trans_docs_text.yml | 53 ++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/update_trans_docs_text.yml diff --git a/.github/workflows/update_trans_docs_text.yml b/.github/workflows/update_trans_docs_text.yml new file mode 100644 index 000000000000..2c4b4ba2c444 --- /dev/null +++ b/.github/workflows/update_trans_docs_text.yml @@ -0,0 +1,53 @@ +name: Update Text and Language Files + +on: + schedule: + - cron: '0 0 * * *' # Runs every day at midnight. Adjust the timing as needed. + workflow_dispatch: # Allows you to manually trigger the workflow. + +jobs: + update-and-pr: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.10' + + - name: Update Text and Languages for All Locales + run: | + cd doc + make update-text + for langDir in locales/*; do + if [ -d "$langDir" ]; then + lang=$(basename $langDir) + echo "Updating language $lang" + make update-lang lang=$lang + fi + done + + - name: Commit changes + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add . + git commit -m "Update text and language files" || echo "No changes to commit" + + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: 'create-pr-branch' # This is the branch where changes will be pushed + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + branch: 'create-pr-branch' # Ensure this matches the branch above + delete-branch: true + title: 'Update text and language files' + body: 'This PR is auto-generated to update text and language files.' + draft: false