forked from greyireland/algorithm-pattern
-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (31 loc) · 1.31 KB
/
Copy pathsyncUpstream.yml
File metadata and controls
35 lines (31 loc) · 1.31 KB
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
name: 'Upstream Sync'
permissions: write-all
on:
schedule:
- cron: '0 */12 * * *' # 每 12 小时同步一次
workflow_dispatch: # 允许手动点击按钮触发
jobs:
sync_latest_from_upstream:
runs-on: ubuntu-latest
name: Sync latest commits from upstream repo
steps:
# 第一步:检出你的 Fork 仓库
- name: Checkout target repo
uses: actions/checkout@v7
with:
token: ${{ secrets.SYNCUPSTREAM_TOKEN }} # 使用你刚才设置的 Secret
# 第二步:运行同步 Action
- name: Sync upstream changes
id: sync
uses: aormsby/Fork-Sync-With-Upstream-action@v3.4.3
with:
upstream_sync_repo: greyireland/algorithm-pattern # 【需修改】填入原作者的 仓库路径
upstream_sync_branch: master # 【需修改】原作者的主分支名
target_sync_branch: master # 你的同步分支名
target_repo_token: ${{ secrets.SYNCUPSTREAM_TOKEN }} # 确认 Secret 名称一致
upstream_repo_access_token: ${{ secrets.SYNCUPSTREAM_TOKEN }}
# 策略设置
test_mode: false # 设为 true 可以测试而不实际推送
- name: Check for errors
if: failure()
run: echo "同步失败,可能存在冲突,请手动处理。"