-
Notifications
You must be signed in to change notification settings - Fork 27
46 lines (44 loc) · 1.52 KB
/
translate.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Translate
on:
pull_request:
branches:
- main
paths:
- "docs/**/*.md"
- "docs/**/*.mdx"
jobs:
ja:
runs-on: ubuntu-latest
# Do not run translation on PRs from forks since they don't have access to the SIMPLEEN secret
if: ${{ !github.event.pull_request.head.repo.fork }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.sha }}
- uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
- uses: actions/setup-node@v3
with:
node-version: "20"
- run: |
node translate/list.mjs ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | tee /tmp/modified
- run: |
node translate/translate.mjs $(cat /tmp/modified)
env:
SIMPLEEN_AUTH_KEY: ${{ secrets.SIMPLEEN_AUTH_KEY }}
SIMPLEEN_TRANSLATOR_ID: ${{ secrets.SIMPLEEN_TRANSLATOR_ID }}
TARGET_LANG: ja
- run: git diff
- uses: peter-evans/create-pull-request@v5
with:
add-paths: i18n/ja/docusaurus-plugin-content-docs/current/
base: main
branch: ja/${{ github.event.pull_request.head.ref }}
author: GitHub <[email protected]>
commit-message: ${{ github.event.pull_request.title }} [ja]
title: ${{ github.event.pull_request.title }} [ja]
body: |
Auto translated PR from #${{ github.event.pull_request.number }}
cc: @MomentoBigFun @Yoshiitaka
reviewers: poppoerika