Skip to content

Commit 59b4961

Browse files
authored
Merge pull request tangly1024#2152 from labulac/main
feat: Create sync.yaml, Add auto sync
2 parents bddc400 + 8d8f2bd commit 59b4961

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/sync.yaml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Upstream Sync
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
schedule:
8+
- cron: "0 0 * * *" # every day
9+
workflow_dispatch:
10+
11+
jobs:
12+
sync_latest_from_upstream:
13+
name: Sync latest commits from upstream repo
14+
runs-on: ubuntu-latest
15+
if: ${{ github.event.repository.fork }}
16+
17+
steps:
18+
# Step 1: run a standard checkout action
19+
- name: Checkout target repo
20+
uses: actions/checkout@v3
21+
22+
# Step 2: run the sync action
23+
- name: Sync upstream changes
24+
id: sync
25+
uses: aormsby/[email protected]
26+
with:
27+
upstream_sync_repo: tangly1024/NotionNext
28+
upstream_sync_branch: main
29+
target_sync_branch: main
30+
target_repo_token: ${{ secrets.GITHUB_TOKEN }} # automatically generated, no need to set
31+
32+
# Set test_mode true to run tests instead of the true action!!
33+
test_mode: false
34+
35+
- name: Sync check
36+
if: failure()
37+
run: |
38+
echo "[Error] 由于上游仓库的 workflow 文件变更,导致 GitHub 自动暂停了本次自动更新,你需要手动 Sync Fork 一次。
39+
exit 1

0 commit comments

Comments
 (0)