-
Notifications
You must be signed in to change notification settings - Fork 9
47 lines (41 loc) · 1.42 KB
/
sync-pages.yml
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
47
name: sync docs from linglong
on:
schedule:
- cron: "0 5 * * 1"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout linglong pages
uses: actions/checkout@v4
with:
path: linglong
repository: OpenAtomFoundation/linglong
sparse-checkout: |
docs/pages
sparse-checkout-cone-mode: false
- name: checkout self
uses: actions/checkout@v4
with:
path: self
sparse-checkout: |
en
guide
sparse-checkout-cone-mode: false
- name: get diff
run: |
diff -Naur self linglong/docs/pages &> changed.txt || true
if [ ! -s changed.txt ]; then
echo "No docs have been changed, terminate normally."
exit 0
fi
cp -r linglong/docs/pages/en/* self/en/
cp -r linglong/docs/pages/guide/* self/guide/
- name: create pr
uses: peter-evans/create-pull-request@v6
with:
path: self
commit-message: "sync docs automatically."
title: "Sync docs from linglong"
delete-branch: true