From c8d22456168ac38e64378f4d68ab7e8c0aa9d06e Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Tue, 14 Apr 2026 16:19:59 +1000 Subject: [PATCH 1/3] ci: add rebase-translations workflow (action-translation v0.15.0) --- .github/workflows/rebase-translations.yml | 37 +++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/rebase-translations.yml diff --git a/.github/workflows/rebase-translations.yml b/.github/workflows/rebase-translations.yml new file mode 100644 index 0000000..87a1868 --- /dev/null +++ b/.github/workflows/rebase-translations.yml @@ -0,0 +1,37 @@ +# 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. +# +# This eliminates merge conflicts caused by multiple upstream PRs +# modifying the same files. See: https://github.com/QuantEcon/action-translation/issues/63 +# +# Place this file at: .github/workflows/rebase-translations.yml + +name: Rebase Translation PRs + +on: + pull_request: + types: [closed] + +jobs: + rebase: + # Only run when a translation-sync PR is merged + if: > + github.event.pull_request.merged == true && + startsWith(github.event.pull_request.head.ref, 'translation-sync-') + runs-on: ubuntu-latest + + # Prevent concurrent rebases from overlapping + concurrency: + group: rebase-translations + cancel-in-progress: false + + steps: + - name: Rebase conflicted translation PRs + uses: quantecon/action-translation@v0.15 + with: + mode: rebase + anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }} + github-token: ${{ secrets.GITHUB_TOKEN }} From 26d21d208958cfa2cace0ab073fde4f0bcca3d18 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Tue, 14 Apr 2026 16:31:24 +1000 Subject: [PATCH 2/3] Update .github/workflows/rebase-translations.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/rebase-translations.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rebase-translations.yml b/.github/workflows/rebase-translations.yml index 87a1868..8e6ba10 100644 --- a/.github/workflows/rebase-translations.yml +++ b/.github/workflows/rebase-translations.yml @@ -30,7 +30,7 @@ jobs: steps: - name: Rebase conflicted translation PRs - uses: quantecon/action-translation@v0.15 + uses: QuantEcon/action-translation@v0.15 with: mode: rebase anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }} From 20c41c1979cbbc4f09369d9580a9a136b101dc8e Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Tue, 14 Apr 2026 16:36:04 +1000 Subject: [PATCH 3/3] ci: add permissions block, fix casing and version pin, rename step --- .github/workflows/rebase-translations.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rebase-translations.yml b/.github/workflows/rebase-translations.yml index 8e6ba10..a950a9a 100644 --- a/.github/workflows/rebase-translations.yml +++ b/.github/workflows/rebase-translations.yml @@ -23,14 +23,18 @@ jobs: startsWith(github.event.pull_request.head.ref, 'translation-sync-') runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + # Prevent concurrent rebases from overlapping concurrency: group: rebase-translations cancel-in-progress: false steps: - - name: Rebase conflicted translation PRs - uses: QuantEcon/action-translation@v0.15 + - name: Rebase open translation PRs + uses: QuantEcon/action-translation@v0.15.0 with: mode: rebase anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}