@@ -2,79 +2,79 @@ name: Sync Next.js docs to Korean repo
2
2
3
3
on :
4
4
schedule :
5
- - cron : ' 0 0 * * *' # Runs at 00:00 UTC every day
6
- workflow_dispatch : # Allows manual triggering
5
+ - cron : ' 0 0 * * *' # Runs at 00:00 UTC every day
6
+ workflow_dispatch : # Allows manual triggering
7
7
8
8
jobs :
9
9
sync-docs :
10
10
runs-on : ubuntu-latest
11
-
11
+
12
12
steps :
13
- - name : Checkout Next.js
14
- uses : actions/checkout@v2
15
- with :
16
- repository : vercel/next.js
17
- ref : canary
18
- path : next-js
19
- sparse-checkout : |
20
- docs
13
+ - name : Checkout Next.js
14
+ uses : actions/checkout@v2
15
+ with :
16
+ repository : vercel/next.js
17
+ ref : canary
18
+ path : next-js
19
+ sparse-checkout : |
20
+ docs
21
21
22
- - name : Checkout Korean repo
23
- uses : actions/checkout@v2
24
- with :
25
- repository : luciancah/nextjs-ko
26
- token : ${{ secrets.ACTION_PAT }}
27
- path : nextjs-ko
28
- ref : main
22
+ - name : Checkout Korean repo
23
+ uses : actions/checkout@v2
24
+ with :
25
+ repository : luciancah/nextjs-ko
26
+ token : ${{ secrets.ACTION_PAT }}
27
+ path : nextjs-ko
28
+ ref : main
29
29
30
- - name : Configure Git
31
- run : |
32
- git config --global user.name github-actions
33
- git config --global user.email [email protected]
30
+ - name : Configure Git
31
+ run : |
32
+ git config --global user.name github-actions
33
+ git config --global user.email [email protected]
34
34
35
- - name : Sync and check differences
36
- id : sync
37
- run : |
38
- # Ensure target directory exists
39
- mkdir -p nextjs-ko/origin/canary/docs
35
+ - name : Sync and check differences
36
+ id : sync
37
+ run : |
38
+ # Ensure target directory exists
39
+ mkdir -p nextjs-ko/origin/canary/docs
40
40
41
- # Use rsync to sync files and track changes
42
- changes=$(rsync -avrc --delete --out-format="%n" next-js/docs/ nextjs-ko/origin/canary/docs/ | grep -v "/$" || true)
41
+ # Use rsync to sync files and track changes
42
+ changes=$(rsync -avrc --delete --out-format="%n" next-js/docs/ nextjs-ko/origin/canary/docs/ | grep -v "/$" || true)
43
43
44
- # If there are changes, commit and push to docs-update branch
45
- if [ ! -z "$changes" ]; then
46
- cd nextjs-ko
47
- git checkout -B docs-update
48
- git add origin/canary/docs
49
- git commit -m "Sync docs from Next.js
44
+ # If there are changes, commit and push to docs-update branch
45
+ if [ ! -z "$changes" ]; then
46
+ cd nextjs-ko
47
+ git checkout -B docs-update
48
+ git add origin/canary/docs
49
+ git commit -m "Sync docs from Next.js
50
50
51
- Changes:
52
- $changes"
53
- git push -f origin docs-update
54
- echo "has_changes=true" >> $GITHUB_OUTPUT
55
- echo 'changes<<EOF' >> $GITHUB_OUTPUT
56
- echo "$changes" >> $GITHUB_OUTPUT
57
- echo 'EOF' >> $GITHUB_OUTPUT
58
- else
59
- echo "No changes detected"
60
- echo "has_changes=false" >> $GITHUB_OUTPUT
61
- fi
51
+ Changes:
52
+ $changes"
53
+ git push -f origin docs-update
54
+ echo "has_changes=true" >> $GITHUB_OUTPUT
55
+ echo 'changes<<EOF' >> $GITHUB_OUTPUT
56
+ echo "$changes" >> $GITHUB_OUTPUT
57
+ echo 'EOF' >> $GITHUB_OUTPUT
58
+ else
59
+ echo "No changes detected"
60
+ echo "has_changes=false" >> $GITHUB_OUTPUT
61
+ fi
62
62
63
- - name : Create issue for new changes
64
- if : steps.sync.outputs.has_changes == 'true'
65
- uses : actions/github-script@v6
66
- with :
67
- github-token : ${{secrets.ACTION_PAT}}
68
- script : |
69
- const changes = `${{ steps.sync.outputs.changes }}`.split('\n').filter(Boolean);
70
- await github.rest.issues.create({
71
- owner: 'luciancah',
72
- repo: 'nextjs-ko',
73
- title: 'vercel/next.js canary 문서에 업데이트 사항이 있습니다.',
74
- body: `The following files have been updated in the Next.js docs:
63
+ - name : Create issue for new changes
64
+ if : steps.sync.outputs.has_changes == 'true'
65
+ uses : actions/github-script@v6
66
+ with :
67
+ github-token : ${{secrets.ACTION_PAT}}
68
+ script : |
69
+ const changes = `${{ steps.sync.outputs.changes }}`.split('\n').filter(Boolean);
70
+ await github.rest.issues.create({
71
+ owner: 'luciancah',
72
+ repo: 'nextjs-ko',
73
+ title: 'vercel/next.js canary 문서에 업데이트 사항이 있습니다.',
74
+ body: `The following files have been updated in the Next.js docs:
75
75
76
- ${changes.map(file => `- ${file}`).join('\n')}
76
+ ${changes.map(file => `- ${file}`).join('\n')}
77
77
78
- Please review these changes and update the Korean translation accordingly.
79
- The changes have been pushed to the \`docs-update\` branch.`
80
- });
78
+ Please review these changes and update the Korean translation accordingly.
79
+ The changes have been pushed to the \`docs-update\` branch.`
80
+ });
0 commit comments