From 7d1bb1445f8ceb6c0ed0bbbe42c39515057d8485 Mon Sep 17 00:00:00 2001 From: yyh Date: Wed, 7 Jan 2026 17:06:40 +0800 Subject: [PATCH] fix(i18n): add PR creation step to Claude Code workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add PHASE 4: COMMIT AND CREATE PR instructions - Configure git user for commits - Add timeout_minutes parameter 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .github/workflows/translate-i18n-claude.yml | 55 +++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/.github/workflows/translate-i18n-claude.yml b/.github/workflows/translate-i18n-claude.yml index ff5e9b19bd..f4d415726c 100644 --- a/.github/workflows/translate-i18n-claude.yml +++ b/.github/workflows/translate-i18n-claude.yml @@ -41,6 +41,11 @@ jobs: fetch-depth: 0 token: ${{ secrets.GITHUB_TOKEN }} + - name: Configure Git + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + - name: Detect changed files and generate diff id: detect_changes run: | @@ -98,6 +103,8 @@ jobs: uses: anthropics/claude-code-action@v1 with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} + use_oauth: false + timeout_minutes: 55 prompt: | You are a professional i18n synchronization engineer for the Dify project. Your task is to keep all language translations in sync with the English source (en-US). @@ -273,6 +280,54 @@ jobs: 4. Create a single commit with all translation changes 5. If any translation fails, continue with others and report failures + ═══════════════════════════════════════════════════════════════ + ║ PHASE 4: COMMIT AND CREATE PR ║ + ═══════════════════════════════════════════════════════════════ + + After all translations are complete and verified: + + ### Step 4.1: Check for changes + ```bash + git status --porcelain + ``` + + If there are changes: + + ### Step 4.2: Create a new branch and commit + ```bash + BRANCH_NAME="chore/i18n-sync-$(date +%Y%m%d-%H%M%S)" + git checkout -b "$BRANCH_NAME" + git add web/i18n/ + git commit -m "chore(i18n): sync translations with en-US + + - Synced translation files based on en-US changes + - Mode: ${{ steps.detect_changes.outputs.SYNC_MODE }} + - Files: ${{ steps.detect_changes.outputs.CHANGED_FILES }} + + 🤖 Generated with Claude Code GitHub Action" + git push origin "$BRANCH_NAME" + ``` + + ### Step 4.3: Create Pull Request + ```bash + gh pr create \ + --title "chore(i18n): sync translations with en-US" \ + --body "## Summary + + This PR was automatically generated to sync i18n translation files. + + ### Changes + - Mode: ${{ steps.detect_changes.outputs.SYNC_MODE }} + - Files processed: ${{ steps.detect_changes.outputs.CHANGED_FILES }} + + ### Verification + - [x] \`i18n:check\` passed + - [x] \`lint:fix\` applied + + 🤖 Generated with Claude Code GitHub Action" \ + --base main + ``` + claude_args: | --max-turns 100 --model claude-sonnet-4-5-20250929