Skip to content

Commit f0661c5

Browse files
authored
feat: add \translate-resync support to sync workflows (#492)
* 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. * chore: bump action-translation to v0.12.0
1 parent 02e57a5 commit f0661c5

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

.github/workflows/sync-translations-fa.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Sync Translations — Farsi
22
# On merged PR, translate changed lectures into the Farsi target repo.
3+
# Comment \translate-resync on a merged PR to re-trigger sync.
34
name: Sync Translations (Farsi)
45

56
on:
@@ -8,18 +9,22 @@ on:
89
paths:
910
- 'lectures/**/*.md'
1011
- 'lectures/_toc.yml'
12+
issue_comment:
13+
types: [created]
1114

1215
jobs:
1316
sync:
14-
if: github.event.pull_request.merged == true
17+
if: >
18+
(github.event_name == 'pull_request' && github.event.pull_request.merged == true) ||
19+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '\translate-resync'))
1520
runs-on: ubuntu-latest
1621

1722
steps:
1823
- uses: actions/checkout@v6
1924
with:
2025
fetch-depth: 2
2126

22-
- uses: QuantEcon/action-translation@v0.11.2
27+
- uses: QuantEcon/action-translation@v0.12.0
2328
with:
2429
mode: sync
2530
target-repo: QuantEcon/lecture-python-programming.fa

.github/workflows/sync-translations-zh-cn.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Sync Translations — Simplified Chinese
22
# On merged PR, translate changed lectures into the zh-cn target repo.
3+
# Comment \translate-resync on a merged PR to re-trigger sync.
34
name: Sync Translations (Simplified Chinese)
45

56
on:
@@ -8,18 +9,22 @@ on:
89
paths:
910
- 'lectures/**/*.md'
1011
- 'lectures/_toc.yml'
12+
issue_comment:
13+
types: [created]
1114

1215
jobs:
1316
sync:
14-
if: github.event.pull_request.merged == true
17+
if: >
18+
(github.event_name == 'pull_request' && github.event.pull_request.merged == true) ||
19+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '\translate-resync'))
1520
runs-on: ubuntu-latest
1621

1722
steps:
1823
- uses: actions/checkout@v6
1924
with:
2025
fetch-depth: 2
2126

22-
- uses: QuantEcon/action-translation@v0.11.2
27+
- uses: QuantEcon/action-translation@v0.12.0
2328
with:
2429
mode: sync
2530
target-repo: QuantEcon/lecture-python-programming.zh-cn

0 commit comments

Comments
 (0)