Skip to content

Commit 26b14ef

Browse files
authored
Merge pull request #99 from bigcolbert/main
Create sync.yml
2 parents 4fbffd1 + 55995b8 commit 26b14ef

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/sync.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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: cmliu/CF-Workers-docker.io
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 一次,详细教程请查看项目README.md "
39+
echo "[Error] Due to a change in the workflow file of the upstream repository, GitHub has automatically suspended the scheduled automatic update. You need to manually sync your fork. Please refer to the project README.md for instructions. "
40+
exit 1

0 commit comments

Comments
 (0)