Skip to content

Commit 4d9ab6e

Browse files
mmckyCopilot
andauthored
ci: add rebase-translations workflow (#108)
* ci: add rebase-translations workflow (action-translation v0.15.0) * Update .github/workflows/rebase-translations.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * ci: add permissions block, fix casing and version pin, rename step --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 22a145b commit 4d9ab6e

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Rebase Translation PRs
2+
#
3+
# 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.
6+
#
7+
# This eliminates merge conflicts caused by multiple upstream PRs
8+
# modifying the same files. See: https://github.com/QuantEcon/action-translation/issues/63
9+
#
10+
# Place this file at: .github/workflows/rebase-translations.yml
11+
12+
name: Rebase Translation PRs
13+
14+
on:
15+
pull_request:
16+
types: [closed]
17+
18+
jobs:
19+
rebase:
20+
# Only run when a translation-sync PR is merged
21+
if: >
22+
github.event.pull_request.merged == true &&
23+
startsWith(github.event.pull_request.head.ref, 'translation-sync-')
24+
runs-on: ubuntu-latest
25+
26+
permissions:
27+
contents: write
28+
pull-requests: write
29+
30+
# Prevent concurrent rebases from overlapping
31+
concurrency:
32+
group: rebase-translations
33+
cancel-in-progress: false
34+
35+
steps:
36+
- name: Rebase open translation PRs
37+
uses: QuantEcon/action-translation@v0.15.0
38+
with:
39+
mode: rebase
40+
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
41+
github-token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)