Skip to content

Commit 9a22e8a

Browse files
Merge pull request #22 from ous50/ous50-auto-pull-upstream
Create cp_pull_upstream.yml Adds support to sync fork with upstream repo every 6 hours (scheduled) and manually.
2 parents 8bd2173 + 8729878 commit 9a22e8a

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Upstream Sync
2+
3+
permissions:
4+
contents: write
5+
issues: write
6+
actions: write
7+
8+
on:
9+
schedule:
10+
- cron: '0 */6 * * *' # every 6 hours
11+
workflow_dispatch:
12+
13+
jobs:
14+
sync_latest_from_upstream:
15+
name: Sync latest commits from upstream repo
16+
runs-on: ubuntu-latest
17+
if: ${{ github.event.repository.fork }}
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Clean issue notice
23+
uses: actions-cool/issues-helper@v3
24+
with:
25+
actions: 'close-issues'
26+
labels: '🚨 Sync Fail'
27+
28+
- name: Sync upstream changes
29+
id: sync
30+
uses: aormsby/[email protected]
31+
with:
32+
upstream_sync_repo: auto-yui-patch/fiddler-everywhere-patch-automated
33+
upstream_sync_branch: main
34+
target_sync_branch: main
35+
target_repo_token: ${{ secrets.GITHUB_TOKEN }} # automatically generated, no need to set
36+
test_mode: false
37+
38+
- name: Sync check
39+
if: failure()
40+
uses: actions-cool/issues-helper@v3
41+
with:
42+
actions: 'create-issue'
43+
title: '🚨 同步失败 | Sync Fail'
44+
labels: '🚨 Sync Fail'
45+
body: |
46+
Due to a change in the workflow file of the [LobeChat][lobechat] upstream repository, GitHub has automatically suspended the scheduled automatic update. You need to manually sync your fork. Please refer to the detailed [Tutorial][tutorial-en-US] for instructions.
47+
48+
由于 [LobeChat][lobechat] 上游仓库的 workflow 文件变更,导致 GitHub 自动暂停了本次自动更新,你需要手动 Sync Fork 一次,请查看 [详细教程][tutorial-zh-CN]
49+
50+
![](https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/273954625-df80c890-0822-4ac2-95e6-c990785cbed5.png)
51+
52+
[lobechat]: https://github.com/lobehub/lobe-chat
53+
[tutorial-zh-CN]: https://github.com/lobehub/lobe-chat/wiki/Upstream-Sync.zh-CN
54+
[tutorial-en-US]: https://github.com/lobehub/lobe-chat/wiki/Upstream-Sync

0 commit comments

Comments
 (0)