Skip to content

Commit 70347df

Browse files
authored
Create sync.yml
1 parent a4783ea commit 70347df

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/sync.yml

Lines changed: 39 additions & 0 deletions
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/Fork-Sync-With-Upstream-action@v3.4
26+
with:
27+
upstream_sync_repo: NetrisTV/ws-scrcpy
28+
upstream_sync_branch: master
29+
target_sync_branch: master
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 一次,详细教程请查看:https://github.com/Yidadaa/ChatGPT-Next-Web/blob/main/README_CN.md#%E6%89%93%E5%BC%80%E8%87%AA%E5%8A%A8%E6%9B%B4%E6%96%B0"
39+
exit 1

0 commit comments

Comments
 (0)