From a13ecaa8041e012214e2467686a2d57cddf2d541 Mon Sep 17 00:00:00 2001 From: Chenhe Gu Date: Thu, 6 Nov 2025 20:29:30 +0900 Subject: [PATCH] Revert "Test: Fresh Incremental Translation - Round 2" (#87) --- .github/workflows/sync_docs_execute.yml | 32 +++++++++---------------- docs.json | 2 -- en/test-fresh-incremental-first.md | 24 ------------------- en/test-fresh-incremental-second.md | 28 ---------------------- en/test-incremental-first.md | 19 --------------- en/test-incremental-second.md | 22 ----------------- 6 files changed, 11 insertions(+), 116 deletions(-) delete mode 100644 en/test-fresh-incremental-first.md delete mode 100644 en/test-fresh-incremental-second.md delete mode 100644 en/test-incremental-first.md delete mode 100644 en/test-incremental-second.md diff --git a/.github/workflows/sync_docs_execute.yml b/.github/workflows/sync_docs_execute.yml index 12247e9f..2c4262e9 100644 --- a/.github/workflows/sync_docs_execute.yml +++ b/.github/workflows/sync_docs_execute.yml @@ -203,28 +203,18 @@ jobs: - name: Check if translation branch exists if: steps.extract-artifacts.outputs.sync_required == 'true' id: check-branch - uses: actions/github-script@v7 - with: - script: | - const prNumber = '${{ steps.extract-artifacts.outputs.pr_number }}'; - const branchName = `docs-sync-pr-${prNumber}`; + run: | + PR_NUMBER="${{ steps.extract-artifacts.outputs.pr_number }}" + SYNC_BRANCH="docs-sync-pr-${PR_NUMBER}" - try { - await github.rest.repos.getBranch({ - owner: context.repo.owner, - repo: context.repo.repo, - branch: branchName - }); - console.log(`✅ Translation branch exists: ${branchName}`); - core.setOutput('branch_exists', 'true'); - } catch (error) { - if (error.status === 404) { - console.log(`🆕 Translation branch does not exist yet`); - core.setOutput('branch_exists', 'false'); - } else { - throw error; - } - } + # Check if translation branch exists on remote + if git ls-remote --exit-code --heads origin "$SYNC_BRANCH" >/dev/null 2>&1; then + echo "✅ Translation branch exists: $SYNC_BRANCH" + echo "branch_exists=true" >> $GITHUB_OUTPUT + else + echo "🆕 Translation branch does not exist yet" + echo "branch_exists=false" >> $GITHUB_OUTPUT + fi - name: Checkout PR branch if: steps.extract-artifacts.outputs.sync_required == 'true' diff --git a/docs.json b/docs.json index e6f6559b..07579100 100644 --- a/docs.json +++ b/docs.json @@ -30,8 +30,6 @@ { "group": " ", "pages": [ - "en/test-fresh-incremental-first", - "en/test-fresh-incremental-second", { "group": "Getting Started", "pages": [ diff --git a/en/test-fresh-incremental-first.md b/en/test-fresh-incremental-first.md deleted file mode 100644 index 2ffb82d7..00000000 --- a/en/test-fresh-incremental-first.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: Fresh Incremental Test - First File -description: Testing incremental translation with fixed workflow - first file ---- - -# Fresh Incremental Translation Test - First File - -This is the **first file** in our fresh incremental translation test with the English file removal fix. - -## Expected Behavior - -When this PR is created: -1. Translation PR should be created -2. This file should be translated to `cn/` and `jp/` -3. Translation commit should ONLY contain: - - `cn/test-fresh-incremental-first.md` - - `jp/test-fresh-incremental-first.md` - - `docs.json` -4. Translation commit should NOT contain any `en/` files -5. Commit message should include `Last-Processed-Commit: ` - -## Next Step - -After the translation PR is created, we'll push a **second file** to verify incremental updates work correctly. diff --git a/en/test-fresh-incremental-second.md b/en/test-fresh-incremental-second.md deleted file mode 100644 index f401d40d..00000000 --- a/en/test-fresh-incremental-second.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: Fresh Incremental Test - Second File -description: Testing incremental translation with fixed workflow - second file ---- - -# Fresh Incremental Translation Test - Second File - -This is the **second file** in our fresh incremental translation test. - -## Expected Behavior - -When this commit is pushed: -1. Translation PR #86 should be **updated** (not force-pushed) -2. Translation PR should have **2 commits total** -3. Second commit should include new `Last-Processed-Commit: ` -4. Second commit should ONLY contain: - - `cn/test-fresh-incremental-second.md` - - `jp/test-fresh-incremental-second.md` - - `docs.json` (if navigation changed) -5. Second commit should NOT contain any `en/` files -6. First file should NOT be re-translated - -## Success Criteria - -✅ Translation PR has 2 commits (not 1) -✅ Both commits have different SHAs -✅ Git history is preserved (no force-push) -✅ No English source files in any commit diff --git a/en/test-incremental-first.md b/en/test-incremental-first.md deleted file mode 100644 index 34e04900..00000000 --- a/en/test-incremental-first.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: Incremental Test - First File -description: Testing incremental translation workflow with the first file ---- - -# Incremental Translation - First File - -This is the **first file** in our incremental translation test. - -## Expected Behavior - -When this PR is created: -1. Translation PR should be created -2. This file should be translated to `cn/` and `jp/` -3. Commit message should include `Last-Processed-Commit: ` - -## Next Step - -After the translation PR is created, we'll push a **second file** to verify incremental updates work correctly. diff --git a/en/test-incremental-second.md b/en/test-incremental-second.md deleted file mode 100644 index df307a32..00000000 --- a/en/test-incremental-second.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: Incremental Test - Second File -description: Testing incremental translation workflow with the second file ---- - -# Incremental Translation - Second File - -This is the **second file** in our incremental translation test. - -## Expected Behavior - -When this commit is pushed: -1. Translation PR should be **updated** (not force-pushed) -2. Translation PR should have **2 commits total** -3. Second commit message should include the new `Last-Processed-Commit: ` -4. Only this file should be translated (first file should NOT be re-translated) - -## Success Criteria - -✅ Translation PR has 2 commits (not 1) -✅ Both commits have different SHAs -✅ Git history is preserved (no force-push)