Skip to content

Commit 40cca31

Browse files
snomiaoclaude
andcommitted
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 <[email protected]>
1 parent abf7e72 commit 40cca31

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

.github/.i18n-trigger

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# This file is used to trigger the i18n workflow
22
# See .github/workflows/i18n-update-core.yaml
3-
#
3+
#
44
# The workflow will automatically:
55
# 1. Collect i18n strings from the UI
66
# 2. Generate translations using OpenAI
77
# 3. Commit updated locale files
88
#
99
# This trigger was created to fix missing subscription.* translations
1010
# that were added after the last automatic locale update.
11+
#
12+
# Re-triggering after fixing git commit workflow issue (2025-11-10)

.github/workflows/i18n-update-core.yaml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,10 @@ jobs:
4848
run: |
4949
git config --global user.name 'github-actions'
5050
git config --global user.email '[email protected]'
51-
git fetch origin ${{ github.head_ref }}
52-
# Stash any local changes before checkout
53-
git stash -u
54-
git checkout -B ${{ github.head_ref }} origin/${{ github.head_ref }}
55-
# Apply the stashed changes if any
56-
git stash pop || true
5751
git add src/locales/
58-
git diff --staged --quiet || git commit -m "Update locales"
59-
git push origin HEAD:${{ github.head_ref }}
52+
if ! git diff --staged --quiet; then
53+
git commit -m "Update locales"
54+
git push origin HEAD:${{ github.head_ref }}
55+
else
56+
echo "No locale changes to commit"
57+
fi

0 commit comments

Comments
 (0)