From 5fe1c142d3d6ecddd5de70b7e66dcefd0c783cf9 Mon Sep 17 00:00:00 2001 From: Sanzeeb Aryal Date: Tue, 5 Nov 2024 12:09:19 +0545 Subject: [PATCH] Testing GH action for gpt translate --- .github/gpt-po.yml | 17 ++++++++++++----- languages/wp-frontend-delete-account-pl_PL.po | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/gpt-po.yml b/.github/gpt-po.yml index 897594a..526e071 100644 --- a/.github/gpt-po.yml +++ b/.github/gpt-po.yml @@ -13,8 +13,7 @@ jobs: - name: Check out the code uses: actions/checkout@v3 with: - persist-credentials: false # For security, don't persist credentials - fetch-depth: 0 # Fetch all history for accurate commit + fetch-depth: 0 # Fetch all history for accurate commit history - name: Set up Node.js uses: actions/setup-node@v3 @@ -29,13 +28,21 @@ jobs: API_KEY: ${{ secrets.OPENAI_API_KEY }} run: | npx gpt-po --dir languages --key $API_KEY + echo "Translation completed." + + - name: Check Git Status + run: git status # Check if .po files were modified - name: Commit and Push Changes run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" - git add languages/*.po - git commit -m "Update .po files" - git push + if [ -n "$(git status --porcelain)" ]; then + git add languages/*.po + git commit -m "Update .po files with new translations" + git push + else + echo "No changes to commit" + fi env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/languages/wp-frontend-delete-account-pl_PL.po b/languages/wp-frontend-delete-account-pl_PL.po index 74a422f..73fd937 100644 --- a/languages/wp-frontend-delete-account-pl_PL.po +++ b/languages/wp-frontend-delete-account-pl_PL.po @@ -15,7 +15,7 @@ msgstr "" #: includes/Backend.php:51 msgid "Deactivating..." -msgstr "Deaktywacja…" +msgstr "" #: includes/Backend.php:52 msgid "Oops! Something went wrong"