Skip to content

Commit

Permalink
Fix - correct workflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
sanzeeb3 committed Nov 5, 2024
1 parent 5fe1c14 commit 43bbd6b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 49 deletions.
48 changes: 0 additions & 48 deletions .github/gpt-po.yml

This file was deleted.

22 changes: 21 additions & 1 deletion .github/workflows/gpt-po.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Run GPT-PO Command
on:
push:
branches:
- master # Runs the workflow on push to the main branch
- master # Runs the workflow on push to the master branch

jobs:
run-gpt-po:
Expand All @@ -12,6 +12,8 @@ jobs:
steps:
- name: Check out the code
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for accurate commit history

- name: Set up Node.js
uses: actions/setup-node@v3
Expand All @@ -26,3 +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"
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 }}

0 comments on commit 43bbd6b

Please sign in to comment.