🐛 Fix translation review never triggering on auto-labelled PRs#28465
Conversation
The Translation Review workflow triggered only on `pull_request_target` `labeled`/`synchronize`. The `affects:i18n` label is applied automatically by the label-actions workflow using the default `GITHUB_TOKEN`, and GitHub does not start new workflow runs from events triggered by `GITHUB_TOKEN` — so the `labeled` path produced zero runs. Reviews only ever fired when a follow-up push happened to raise a `synchronize` event, which masked the bug until a PR was opened, auto-labelled, and never pushed to again. Trigger on real PR-author events (`opened`/`reopened`/`synchronize`) gated by a `paths` filter on `ghost/i18n/locales/**` instead of relying on the bot-applied label. `labeled` is kept only as a manual maintainer re-trigger. The review script remains the precise final gate.
WalkthroughThe PR updates the Translation Review workflow to shift from label-driven triggering ( Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/scripts/i18n-review/SETUP.md (1)
4-5:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUpdate stale label-driven wording in setup docs.
Line 4 and Line 144 still describe label-based behavior, but the workflow now primarily keys off
paths+ PR-author events. Renamingaffects:i18nno longer disables normal runs, and the opening description should reflect path-based triggering.Suggested doc patch
- that posts an advisory (non-approving) GitHub review on PRs labelled `affects:i18n`. + that posts an advisory (non-approving) GitHub review on PRs that touch locale files under `ghost/i18n/locales/**`. - - Or simply rename the `affects:i18n` label — the conditional won't match + - Or comment out/disable the workflow trigger block in `translation-review.yml` (label renaming only affects the manual `labeled` re-trigger path)Also applies to: 144-145
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/scripts/i18n-review/SETUP.md around lines 4 - 5, Update the stale label-driven wording that claims runs are gated by the `affects:i18n` label and that renaming it disables normal runs; instead state that the workflow is triggered primarily by changed paths and PR-author events (e.g., path-based triggers) and no longer relies on label presence to allow runs. Search for occurrences of the literal label `affects:i18n` and the opening description/top-level summary and the later paragraph that mentions disabling runs, then replace those sentences to explain path-based triggering and that renaming the label does not stop workflows from running. Ensure the new wording briefly describes "paths" + PR-author events as the trigger mechanism and removes any implication that removing/renaming the label disables workflow execution.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In @.github/scripts/i18n-review/SETUP.md:
- Around line 4-5: Update the stale label-driven wording that claims runs are
gated by the `affects:i18n` label and that renaming it disables normal runs;
instead state that the workflow is triggered primarily by changed paths and
PR-author events (e.g., path-based triggers) and no longer relies on label
presence to allow runs. Search for occurrences of the literal label
`affects:i18n` and the opening description/top-level summary and the later
paragraph that mentions disabling runs, then replace those sentences to explain
path-based triggering and that renaming the label does not stop workflows from
running. Ensure the new wording briefly describes "paths" + PR-author events as
the trigger mechanism and removes any implication that removing/renaming the
label disables workflow execution.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 31b03982-61e7-474a-b851-3ea01f4d607b
📒 Files selected for processing (2)
.github/scripts/i18n-review/SETUP.md.github/workflows/translation-review.yml
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #28465 +/- ##
=======================================
Coverage 73.74% 73.74%
=======================================
Files 1541 1541
Lines 132184 132184
Branches 15784 15784
=======================================
Hits 97484 97484
Misses 33733 33733
Partials 967 967
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
no ref
Problem
The Translation Review workflow (
translation-review.yml) triggered only onpull_request_targetlabeled/synchronize, gated on theaffects:i18nlabel.That label is applied automatically by the label-actions workflow using the default
GITHUB_TOKEN. GitHub deliberately does not start new workflow runs from events triggered byGITHUB_TOKEN, so thelabeledpath has produced zero runs since the workflow shipped.Reviews still appeared because i18n PRs almost always get a follow-up push (a translator iterating, or a "Merge branch 'main'" commit) which raises a
synchronizeevent — and that's what actually ran the job. The bug stayed hidden until a PR was opened, auto-labelled, and never pushed to again (e.g. #28462), which got no review at all.Evidence (PR #28434)
10:23:49affects:i18nadded bygithub-actions[bot]→ no run13:32:07push "Merge branch 'main'" →synchronize→ run13:32:14→ review13:32:3714:24:38push "Merge branch 'main'" →synchronize→ run14:24:45→ review14:25:05Every run that produced a review was
synchronize; none fired at label-time. Same pattern across every i18n PR sampled.Fix
Trigger on real PR-author events (
opened/reopened/synchronize) gated by apathsfilter onghost/i18n/locales/**, instead of relying on the bot-applied label. These events come from the PR author (notGITHUB_TOKEN), so they aren't suppressed.labeledis kept only as a manual maintainer re-trigger (remove + re-add the label).The review script remains the precise final gate — it only reviews
ghost/i18n/locales/<locale>/<namespace>.json(excludingen/) and exits cheaply otherwise, so the broaderpathsglob costs at most a no-op checkout.No change to the security posture: still
pull_request_targetchecking outmain(never the PR head), reading the diff via API only, with the existing file/line/timeout abuse guards intact.SETUP.md updated to document the new triggers and the
GITHUB_TOKENrationale.