Repository navigation
ci: sync translations only for PRs merged into main - #1056
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 <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
The workflow still allows \translate-resync issue_comment-triggered runs on merged PRs whose base branch is not main, which can undermine the PR’s stated “only for main merges” intent unless separately enforced by the pinned action version.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This PR tightens the translation-sync automation so it only triggers on PRs merged into the main branch, preventing unintended translation PRs when work is merged into long-lived non-publishing branches.
Changes:
- Restrict the translation sync workflow’s
pull_request: types: [closed]trigger tobranches: [main]. - Add inline comments explaining why the base-branch filter is required.
File summaries
| File | Description |
|---|---|
| .github/workflows/sync-translations-zh-cn.yml | Adds a pull_request base-branch filter so sync runs only for merges into main. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| # Only merges into main sync. Without this, a PR merged into any branch | ||
| # (a long-lived migration branch, say) opens translation PRs for content | ||
| # the published edition does not carry. | ||
| branches: [main] |
📖 Netlify Preview Ready!Preview URL: https://pr-1056--sunny-cactus-210e3e.netlify.app Commit: Build Info
|
Co-Authored-By: Claude Fable 5.1 <[email protected]>
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