ci: sync translations only for PRs merged into main - #630
Merged
Merged
Conversation
The sync workflows triggered on `pull_request: types: [closed]` with no `branches:` filter, so a PR merged into any branch fired them. A merge into the long-lived `jb2` branch opened translation PRs in every target repo for content the published edition does not carry. Mirrors the template change in QuantEcon/action-translation#308 (v0.28.1). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The issue_comment (\translate-resync) trigger path can still run the workflow for PRs merged into non-main branches, so the new guard does not fully prevent the reported unintended syncs.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This PR tightens the translation-sync GitHub Actions workflows so they only run for pull requests merged into the main branch, preventing translation PRs from being opened due to merges into long-lived work branches.
Changes:
- Add
branches: [main]to thepull_request(types:closed) trigger in each translation-sync workflow. - Document why the branch filter is needed to avoid unintended syncs from non-publication merges.
File summaries
| File | Description |
|---|---|
| .github/workflows/sync-translations-zh-cn.yml | Restricts PR-merge translation sync trigger to main for zh-cn. |
| .github/workflows/sync-translations-fr.yml | Restricts PR-merge translation sync trigger to main for French. |
| .github/workflows/sync-translations-fa.yml | Restricts PR-merge translation sync trigger to main for Farsi. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
branches: [main]to thepull_requesttrigger of every translation-sync workflow in this repo.Why.
pull_request: types: [closed]fires for a PR closed against any base branch, and the job'smerged == truecheck does not look at the base either. On 2026-09-12 a theme migration merged into the long-livedjb2branch fired the sync workflows and opened translation PRs in the target repos for content the published edition does not carry (those PRs have been closed). A merge into a work branch is not a publication event.What changes. One line (plus a comment) per workflow: the trigger now requires the PR's base to be
main. The\translate-resynccomment path is unchanged here; the action itself now refuses a resync on a PR whose base is not the default branch, as of QuantEcon/action-translation v0.28.1 (see QuantEcon/action-translation#308). Until@v0carries that release, this filter is the only guard, which is why it lands now rather than waiting.When
jb2itself merges intomain, that PR will trigger a sync that carries its accumulated changes in one run, as intended.🤖 Generated with Claude Code