Skip to content

Commit

Permalink
Testing GH action for gpt translate
Browse files Browse the repository at this point in the history
  • Loading branch information
sanzeeb3 committed Nov 5, 2024
1 parent c4bf56c commit 5fe1c14
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
17 changes: 12 additions & 5 deletions .github/gpt-po.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
2 changes: 1 addition & 1 deletion languages/wp-frontend-delete-account-pl_PL.po
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ msgstr ""

#: includes/Backend.php:51
msgid "Deactivating..."
msgstr "Deaktywacja…"
msgstr ""

#: includes/Backend.php:52
msgid "Oops! Something went wrong"
Expand Down

0 comments on commit 5fe1c14

Please sign in to comment.