mirror of
https://github.com/cmliu/edgetunnel.git
synced 2026-10-29 18:21:41 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a8ab11125e | ||
|
|
af4f9837e1 | ||
|
|
448a83ced0 | ||
|
|
fb3212257e | ||
|
|
fd3c60da3a | ||
|
|
c2de6514ab | ||
|
|
809159a534 | ||
|
|
e2da274be4 | ||
|
|
92fc6cc4a4 | ||
|
|
0b5877f61a | ||
|
|
1c20518cd1 | ||
|
|
fa5a3a6022 | ||
|
|
1ab67e7da5 | ||
|
|
867fd1e3d1 | ||
|
|
6054f8253a |
+21
-17
@@ -15,26 +15,30 @@ jobs:
|
|||||||
if: ${{ github.event.repository.fork }}
|
if: ${{ github.event.repository.fork }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# Step 1: run a standard checkout action
|
|
||||||
- name: Checkout target repo
|
- name: Checkout target repo
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
# Step 2: run the sync action
|
|
||||||
- name: Sync upstream changes
|
|
||||||
id: sync
|
|
||||||
uses: aormsby/fork-sync-with-upstream-action@v3.4.3
|
|
||||||
with:
|
with:
|
||||||
upstream_sync_repo: cmliu/edgetunnel
|
fetch-depth: 0
|
||||||
upstream_sync_branch: main
|
ref: main
|
||||||
target_sync_branch: main
|
|
||||||
target_repo_token: ${{ secrets.GITHUB_TOKEN }} # automatically generated, no need to set
|
|
||||||
|
|
||||||
# Set test_mode true to run tests instead of the true action!!
|
- name: Sync upstream changes
|
||||||
test_mode: false
|
|
||||||
|
|
||||||
- name: Sync check
|
|
||||||
if: failure()
|
|
||||||
run: |
|
run: |
|
||||||
echo "[Error] 由于上游仓库的 workflow 文件变更,导致 GitHub 自动暂停了本次自动更新,你需要手动 Sync Fork 一次,详细教程请查看项目README.md "
|
git config user.name "GH Action - Upstream Sync"
|
||||||
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. "
|
git config user.email "action@github.com"
|
||||||
|
|
||||||
|
git remote add upstream https://github.com/cmliu/edgetunnel.git
|
||||||
|
git fetch upstream main
|
||||||
|
|
||||||
|
if git diff --quiet HEAD upstream/main; then
|
||||||
|
# 内容和上游一致,直接对齐,顺带清理历史分叉留下的多余 merge commit
|
||||||
|
git reset --hard upstream/main
|
||||||
|
git push --force-with-lease origin main
|
||||||
|
else
|
||||||
|
# 有本地修改,保持原来的合并方式,不覆盖任何人的改动
|
||||||
|
if ! git pull --no-rebase upstream main; then
|
||||||
|
echo "[Error] 合并上游变更产生冲突,自动同步已暂停,请手动 Sync Fork 并解决冲突。"
|
||||||
|
echo "[Error] Merge conflict detected while syncing upstream. Please sync your fork manually and resolve the conflicts."
|
||||||
exit 1
|
exit 1
|
||||||
|
fi
|
||||||
|
git push origin main
|
||||||
|
fi
|
||||||
Reference in new issue
Block a user