Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions .github/workflows/rebase-translations.yml
Original file line number Diff line number Diff line change
@@ -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 `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
Expand All @@ -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 `translate forward --github`
# creates `resync/*`, and a wave of resync PRs goes stale the same way.
Comment thread
Copilot marked this conversation as resolved.
# 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:
Expand Down
Loading