From 503e557b9239238011c41bafe3a1297f75c55cd2 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Tue, 21 Jul 2026 11:22:54 +1000 Subject: [PATCH 1/2] Rebase: also match resync/* branches (action-translation v0.18.1) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The rebase workflow only fired for `translation-sync-*` branches, which the Action's sync mode creates. The CLI's `translate forward --github` creates `resync/{stem}` branches, so merging one resync PR never rebased its siblings — during a drift-recovery wave that leaves a stack of open PRs whose bases go stale with every merge. Fixed engine-side in action-translation v0.18.1, but the action-side half is not sufficient on its own: this `if` gates whether the job runs at all, and it runs before the action does. Both layers must list both prefixes or the result is a job that never starts. Brings this file in step with the upstream template as of that release. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/rebase-translations.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rebase-translations.yml b/.github/workflows/rebase-translations.yml index 37f5daa..40799f6 100644 --- a/.github/workflows/rebase-translations.yml +++ b/.github/workflows/rebase-translations.yml @@ -1,8 +1,10 @@ # Rebase Translation PRs # # Install this workflow in the TARGET (translated) repository. -# When a translation-sync PR is merged, this workflow automatically -# rebases other open translation-sync PRs against the updated main branch. +# When a translation PR is merged, this workflow automatically rebases the +# other open translation PRs against the updated main branch. It covers both +# kinds this tool creates: `translation-sync-*` branches from the Action's sync +# mode, and `resync/*` branches from the CLI's `forward --github`. # # This eliminates merge conflicts caused by multiple upstream PRs # modifying the same files. See: https://github.com/QuantEcon/action-translation/issues/63 @@ -17,10 +19,16 @@ on: jobs: rebase: - # Only run when a translation-sync PR is merged + # Only run when a translation PR is merged. Both prefixes must be listed: + # sync mode creates `translation-sync-*`, while the CLI's `forward --github` + # creates `resync/*`, and a wave of resync PRs goes stale the same way. + # Keep this in step with `isTranslationBranch` in the action's src/branch-naming.ts + # — this `if` decides whether the job runs, that predicate decides which open PRs + # it then rebases, so a prefix matching only one of them is a no-op run. if: > github.event.pull_request.merged == true && - startsWith(github.event.pull_request.head.ref, 'translation-sync-') + (startsWith(github.event.pull_request.head.ref, 'translation-sync-') || + startsWith(github.event.pull_request.head.ref, 'resync/')) runs-on: ubuntu-latest permissions: From 974b3eda217b84623521f04b3f7cee52777e05a6 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Tue, 21 Jul 2026 14:02:06 +1000 Subject: [PATCH 2/2] Comment accuracy: the CLI command is 'translate forward --github' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The bare 'forward --github' is not a runnable invocation — the binary is 'translate'. Caught by Copilot on lecture-python-programming.fr#15; applied estate-wide so the copies stay in step with the upstream template, which gets the same fix. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/rebase-translations.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rebase-translations.yml b/.github/workflows/rebase-translations.yml index 40799f6..25a9870 100644 --- a/.github/workflows/rebase-translations.yml +++ b/.github/workflows/rebase-translations.yml @@ -4,7 +4,7 @@ # When a translation PR is merged, this workflow automatically rebases the # other open translation PRs against the updated main branch. It covers both # kinds this tool creates: `translation-sync-*` branches from the Action's sync -# mode, and `resync/*` branches from the CLI's `forward --github`. +# mode, and `resync/*` branches from the CLI's `translate forward --github`. # # This eliminates merge conflicts caused by multiple upstream PRs # modifying the same files. See: https://github.com/QuantEcon/action-translation/issues/63 @@ -20,7 +20,7 @@ on: jobs: rebase: # Only run when a translation PR is merged. Both prefixes must be listed: - # sync mode creates `translation-sync-*`, while the CLI's `forward --github` + # sync mode creates `translation-sync-*`, while the CLI's `translate forward --github` # creates `resync/*`, and a wave of resync PRs goes stale the same way. # Keep this in step with `isTranslationBranch` in the action's src/branch-naming.ts # — this `if` decides whether the job runs, that predicate decides which open PRs