From 6ec622571cf0ded611b7124bee6faf747916b24d Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Mon, 23 Mar 2026 15:50:53 +1100 Subject: [PATCH 1/2] feat: add issue_comment trigger for \translate-resync support Add issue_comment trigger to both sync-translations workflows so that commenting \translate-resync on a merged PR re-triggers translation sync. This enables recovery from transient sync failures without re-opening PRs. Companion to QuantEcon/action-translation#39. --- .github/workflows/sync-translations-fa.yml | 7 ++++++- .github/workflows/sync-translations-zh-cn.yml | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync-translations-fa.yml b/.github/workflows/sync-translations-fa.yml index 4c8ee406..5d35e7d0 100644 --- a/.github/workflows/sync-translations-fa.yml +++ b/.github/workflows/sync-translations-fa.yml @@ -1,5 +1,6 @@ # Sync Translations — Farsi # On merged PR, translate changed lectures into the Farsi target repo. +# Comment \translate-resync on a merged PR to re-trigger sync. name: Sync Translations (Farsi) on: @@ -8,10 +9,14 @@ on: paths: - 'lectures/**/*.md' - 'lectures/_toc.yml' + issue_comment: + types: [created] jobs: sync: - if: github.event.pull_request.merged == true + if: > + (github.event_name == 'pull_request' && github.event.pull_request.merged == true) || + (github.event_name == 'issue_comment' && contains(github.event.comment.body, '\translate-resync')) runs-on: ubuntu-latest steps: diff --git a/.github/workflows/sync-translations-zh-cn.yml b/.github/workflows/sync-translations-zh-cn.yml index 16cf6b4f..9baf281d 100644 --- a/.github/workflows/sync-translations-zh-cn.yml +++ b/.github/workflows/sync-translations-zh-cn.yml @@ -1,5 +1,6 @@ # Sync Translations — Simplified Chinese # On merged PR, translate changed lectures into the zh-cn target repo. +# Comment \translate-resync on a merged PR to re-trigger sync. name: Sync Translations (Simplified Chinese) on: @@ -8,10 +9,14 @@ on: paths: - 'lectures/**/*.md' - 'lectures/_toc.yml' + issue_comment: + types: [created] jobs: sync: - if: github.event.pull_request.merged == true + if: > + (github.event_name == 'pull_request' && github.event.pull_request.merged == true) || + (github.event_name == 'issue_comment' && contains(github.event.comment.body, '\translate-resync')) runs-on: ubuntu-latest steps: From 3f11ce65370bfa79fa5b3a4dee9680824d134efe Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Mon, 23 Mar 2026 16:45:37 +1100 Subject: [PATCH 2/2] chore: bump action-translation to v0.12.0 --- .github/workflows/sync-translations-fa.yml | 2 +- .github/workflows/sync-translations-zh-cn.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync-translations-fa.yml b/.github/workflows/sync-translations-fa.yml index 5d35e7d0..037d2ab7 100644 --- a/.github/workflows/sync-translations-fa.yml +++ b/.github/workflows/sync-translations-fa.yml @@ -24,7 +24,7 @@ jobs: with: fetch-depth: 2 - - uses: QuantEcon/action-translation@v0.11.2 + - uses: QuantEcon/action-translation@v0.12.0 with: mode: sync target-repo: QuantEcon/lecture-python-programming.fa diff --git a/.github/workflows/sync-translations-zh-cn.yml b/.github/workflows/sync-translations-zh-cn.yml index 9baf281d..1829f791 100644 --- a/.github/workflows/sync-translations-zh-cn.yml +++ b/.github/workflows/sync-translations-zh-cn.yml @@ -24,7 +24,7 @@ jobs: with: fetch-depth: 2 - - uses: QuantEcon/action-translation@v0.11.2 + - uses: QuantEcon/action-translation@v0.12.0 with: mode: sync target-repo: QuantEcon/lecture-python-programming.zh-cn