fix: Correct i18n workflow git commit logic

The previous workflow was resetting the branch which discarded the
generated locale changes. This fix simplifies the commit logic to
just add and commit the changes directly without branch manipulation.

The issue was:
- git stash + git checkout -B would reset to remote, losing changes
- The detached HEAD in GitHub Actions made stash operations unreliable

The fix:
- Remove unnecessary git stash/checkout operations
- Directly add, commit, and push the locale changes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
snomiao
2025-11-10 10:00:20 +00:00
committed by Alexander Brown
parent 02f8ce22a5
commit 1415b5591f
2 changed files with 9 additions and 9 deletions

View File

@@ -48,12 +48,10 @@ jobs:
run: |
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com'
git fetch origin ${{ github.head_ref }}
# Stash any local changes before checkout
git stash -u
git checkout -B ${{ github.head_ref }} origin/${{ github.head_ref }}
# Apply the stashed changes if any
git stash pop || true
git add src/locales/
git diff --staged --quiet || git commit -m "Update locales"
git push origin HEAD:${{ github.head_ref }}
if ! git diff --staged --quiet; then
git commit -m "Update locales"
git push origin HEAD:${{ github.head_ref }}
else
echo "No locale changes to commit"
fi