Skip to content

Commit c5c2ce1

Browse files
mmckyclaude
andauthored
Rebase: also match resync/* branches (action-translation v0.18.1) (#186)
* Rebase: also match resync/* branches (action-translation v0.18.1) 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) <noreply@anthropic.com> * Comment accuracy: the CLI command is 'translate forward --github' 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) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 23c6245 commit c5c2ce1

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

.github/workflows/rebase-translations.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Rebase Translation PRs
22
#
33
# Install this workflow in the TARGET (translated) repository.
4-
# When a translation-sync PR is merged, this workflow automatically
5-
# rebases other open translation-sync PRs against the updated main branch.
4+
# When a translation PR is merged, this workflow automatically rebases the
5+
# other open translation PRs against the updated main branch. It covers both
6+
# kinds this tool creates: `translation-sync-*` branches from the Action's sync
7+
# mode, and `resync/*` branches from the CLI's `translate forward --github`.
68
#
79
# This eliminates merge conflicts caused by multiple upstream PRs
810
# modifying the same files. See: https://github.com/QuantEcon/action-translation/issues/63
@@ -17,10 +19,16 @@ on:
1719

1820
jobs:
1921
rebase:
20-
# Only run when a translation-sync PR is merged
22+
# Only run when a translation PR is merged. Both prefixes must be listed:
23+
# sync mode creates `translation-sync-*`, while the CLI's `translate forward --github`
24+
# creates `resync/*`, and a wave of resync PRs goes stale the same way.
25+
# Keep this in step with `isTranslationBranch` in the action's src/branch-naming.ts
26+
# — this `if` decides whether the job runs, that predicate decides which open PRs
27+
# it then rebases, so a prefix matching only one of them is a no-op run.
2128
if: >
2229
github.event.pull_request.merged == true &&
23-
startsWith(github.event.pull_request.head.ref, 'translation-sync-')
30+
(startsWith(github.event.pull_request.head.ref, 'translation-sync-') ||
31+
startsWith(github.event.pull_request.head.ref, 'resync/'))
2432
runs-on: ubuntu-latest
2533

2634
permissions:

0 commit comments

Comments
 (0)